mirror of
https://github.com/openssl/openssl.git
synced 2024-11-27 05:21:51 +08:00
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)
This commit is contained in:
parent
bb90d02a71
commit
ed874fac63
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user