diff options
author | Rich Salz <rsalz@openssl.org> | 2015-05-01 10:15:18 -0400 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2015-05-01 10:15:18 -0400 |
commit | efa7dd64443f246004751bdaa5671bf6836e07ff (patch) | |
tree | df55d807a97d046ce17eb12adca78ea36a6038fa /test | |
parent | b548a1f11c06ccdfa4f52a539912d22d77ee309e (diff) | |
download | openssl-efa7dd64443f246004751bdaa5671bf6836e07ff.tar.gz |
free NULL cleanup 11
Don't check for NULL before calling free functions. This gets:
ERR_STATE_free
ENGINE_free
DSO_free
CMAC_CTX_free
COMP_CTX_free
CONF_free
NCONF_free NCONF_free_data _CONF_free_data
A sk_free use within OBJ_sigid_free
TS_TST_INFO_free (rest of TS_ API was okay)
Doc update for UI_free (all uses were fine)
X509V3_conf_free
X509V3_section_free
X509V3_string_free
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'test')
-rw-r--r-- | test/enginetest.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/test/enginetest.c b/test/enginetest.c index ab7c0c00dd..2d9afaaed1 100644 --- a/test/enginetest.c +++ b/test/enginetest.c @@ -147,8 +147,7 @@ int main(int argc, char *argv[]) printf("Remove failed!\n"); goto end; } - if (ptr) - ENGINE_free(ptr); + ENGINE_free(ptr); display_engine_list(); if (!ENGINE_add(new_h3) || !ENGINE_add(new_h2)) { printf("Add failed!\n"); @@ -196,8 +195,7 @@ int main(int argc, char *argv[]) if (!ENGINE_remove(ptr)) printf("Remove failed!i - probably no hardware " "support present.\n"); - if (ptr) - ENGINE_free(ptr); + ENGINE_free(ptr); display_engine_list(); if (!ENGINE_add(new_h1) || !ENGINE_remove(new_h1)) { printf("Couldn't add and remove to an empty list!\n"); @@ -248,17 +246,12 @@ int main(int argc, char *argv[]) end: if (to_return) ERR_print_errors_fp(stderr); - if (new_h1) - ENGINE_free(new_h1); - if (new_h2) - ENGINE_free(new_h2); - if (new_h3) - ENGINE_free(new_h3); - if (new_h4) - ENGINE_free(new_h4); + ENGINE_free(new_h1); + ENGINE_free(new_h2); + ENGINE_free(new_h3); + ENGINE_free(new_h4); for (loop = 0; loop < 512; loop++) - if (block[loop]) - ENGINE_free(block[loop]); + ENGINE_free(block[loop]); ENGINE_cleanup(); CRYPTO_cleanup_all_ex_data(); ERR_free_strings(); |