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;