Commit ed874fac authored by Bernd Edlinger's avatar Bernd Edlinger Committed by Rich Salz
Browse files

Rework error handling of custom_ext_meth_add towards strong exception safety.

parent bb90d02a
Loading
Loading
Loading
Loading
+1 −5
Original line number Original line Diff line number Diff line
@@ -179,12 +179,8 @@ static int custom_ext_meth_add(custom_ext_methods *exts,
    tmp = OPENSSL_realloc(exts->meths,
    tmp = OPENSSL_realloc(exts->meths,
                          (exts->meths_count + 1) * sizeof(custom_ext_method));
                          (exts->meths_count + 1) * sizeof(custom_ext_method));


    if (tmp == NULL) {
    if (tmp == NULL)
        OPENSSL_free(exts->meths);
        exts->meths = NULL;
        exts->meths_count = 0;
        return 0;
        return 0;
    }


    exts->meths = tmp;
    exts->meths = tmp;
    meth = exts->meths + exts->meths_count;
    meth = exts->meths + exts->meths_count;