aboutsummaryrefslogtreecommitdiffstats
path: root/ssl
diff options
context:
space:
mode:
authorBernd Edlinger <bernd.edlinger@hotmail.de>2017-02-15 11:36:17 +0100
committerRich Salz <rsalz@openssl.org>2017-02-15 08:37:52 -0500
commited874fac6399d5064d6eb8fe2022b918aeaf75af (patch)
tree09c2afeb0f71d4edcb5791eda24d4d95ba835233 /ssl
parentbb90d02a71c60bc16389fba4ff06965714b1826f (diff)
downloadopenssl-ed874fac6399d5064d6eb8fe2022b918aeaf75af.tar.gz
Rework error handling of custom_ext_meth_add towards strong exception safety.
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2636)
Diffstat (limited to 'ssl')
-rw-r--r--ssl/t1_ext.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/ssl/t1_ext.c b/ssl/t1_ext.c
index 182164760f..b19e75231f 100644
--- a/ssl/t1_ext.c
+++ b/ssl/t1_ext.c
@@ -179,12 +179,8 @@ static int custom_ext_meth_add(custom_ext_methods *exts,
tmp = OPENSSL_realloc(exts->meths,
(exts->meths_count + 1) * sizeof(custom_ext_method));
- if (tmp == NULL) {
- OPENSSL_free(exts->meths);
- exts->meths = NULL;
- exts->meths_count = 0;
+ if (tmp == NULL)
return 0;
- }
exts->meths = tmp;
meth = exts->meths + exts->meths_count;