diff options
author | Rich Salz <rsalz@openssl.org> | 2015-05-01 10:02:07 -0400 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2015-05-01 10:02:07 -0400 |
commit | b548a1f11c06ccdfa4f52a539912d22d77ee309e (patch) | |
tree | 37ff8792ddf09e4805aa3ba76b805923d3c52734 /crypto/dso | |
parent | 33fbca83dcd05b77f807fab205c4523b8cfe85b5 (diff) | |
download | openssl-b548a1f11c06ccdfa4f52a539912d22d77ee309e.tar.gz |
free null cleanup finale
Don't check for NULL before calling OPENSSL_free
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto/dso')
-rw-r--r-- | crypto/dso/dso_dl.c | 3 | ||||
-rw-r--r-- | crypto/dso/dso_dlfcn.c | 3 | ||||
-rw-r--r-- | crypto/dso/dso_lib.c | 10 | ||||
-rw-r--r-- | crypto/dso/dso_vms.c | 6 | ||||
-rw-r--r-- | crypto/dso/dso_win32.c | 6 |
5 files changed, 9 insertions, 19 deletions
diff --git a/crypto/dso/dso_dl.c b/crypto/dso/dso_dl.c index 989d4d9587..5d5ede03a5 100644 --- a/crypto/dso/dso_dl.c +++ b/crypto/dso/dso_dl.c @@ -143,8 +143,7 @@ static int dl_load(DSO *dso) return (1); err: /* Cleanup! */ - if (filename != NULL) - OPENSSL_free(filename); + OPENSSL_free(filename); if (ptr != NULL) shl_unload(ptr); return (0); diff --git a/crypto/dso/dso_dlfcn.c b/crypto/dso/dso_dlfcn.c index 8ebb2b59c9..92d951fce3 100644 --- a/crypto/dso/dso_dlfcn.c +++ b/crypto/dso/dso_dlfcn.c @@ -182,8 +182,7 @@ static int dlfcn_load(DSO *dso) return (1); err: /* Cleanup! */ - if (filename != NULL) - OPENSSL_free(filename); + OPENSSL_free(filename); if (ptr != NULL) dlclose(ptr); return (0); diff --git a/crypto/dso/dso_lib.c b/crypto/dso/dso_lib.c index c1d6d2544f..a33a8a85bb 100644 --- a/crypto/dso/dso_lib.c +++ b/crypto/dso/dso_lib.c @@ -162,11 +162,8 @@ int DSO_free(DSO *dso) } sk_void_free(dso->meth_data); - if (dso->filename != NULL) - OPENSSL_free(dso->filename); - if (dso->loaded_filename != NULL) - OPENSSL_free(dso->loaded_filename); - + OPENSSL_free(dso->filename); + OPENSSL_free(dso->loaded_filename); OPENSSL_free(dso); return (1); } @@ -360,8 +357,7 @@ int DSO_set_filename(DSO *dso, const char *filename) return (0); } BUF_strlcpy(copied, filename, strlen(filename) + 1); - if (dso->filename) - OPENSSL_free(dso->filename); + OPENSSL_free(dso->filename); dso->filename = copied; return (1); } diff --git a/crypto/dso/dso_vms.c b/crypto/dso/dso_vms.c index 79bbd97122..821e238bd4 100644 --- a/crypto/dso/dso_vms.c +++ b/crypto/dso/dso_vms.c @@ -267,10 +267,8 @@ static int vms_load(DSO *dso) return (1); err: /* Cleanup! */ - if (p != NULL) - OPENSSL_free(p); - if (filename != NULL) - OPENSSL_free(filename); + OPENSSL_free(p); + OPENSSL_free(filename); return (0); } diff --git a/crypto/dso/dso_win32.c b/crypto/dso/dso_win32.c index 2499fc152b..144d8e63c3 100644 --- a/crypto/dso/dso_win32.c +++ b/crypto/dso/dso_win32.c @@ -183,10 +183,8 @@ static int win32_load(DSO *dso) return (1); err: /* Cleanup ! */ - if (filename != NULL) - OPENSSL_free(filename); - if (p != NULL) - OPENSSL_free(p); + OPENSSL_free(filename); + OPENSSL_free(p); if (h != NULL) FreeLibrary(h); return (0); |