summaryrefslogtreecommitdiffstats
path: root/crypto/mem_dbg.c
diff options
context:
space:
mode:
authorRich Salz <rsalz@openssl.org>2015-05-01 20:37:16 +0200
committerRich Salz <rsalz@openssl.org>2015-05-01 20:37:16 +0200
commit25aaa98aa249d26391c1994d2de449562c8b8b99 (patch)
tree6f83efd87fa9fd832e8a456e9686143a29f1dab3 /crypto/mem_dbg.c
parentRemove goto inside an if(0) block (diff)
downloadopenssl-25aaa98aa249d26391c1994d2de449562c8b8b99.tar.xz
openssl-25aaa98aa249d26391c1994d2de449562c8b8b99.zip
free NULL cleanup -- coda
After the finale, the "real" final part. :) Do a recursive grep with "-B1 -w [a-zA-Z0-9_]*_free" to see if any of the preceeding lines are an "if NULL" check that can be removed. Reviewed-by: Tim Hudson <tjh@openssl.org>
Diffstat (limited to 'crypto/mem_dbg.c')
-rw-r--r--crypto/mem_dbg.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/crypto/mem_dbg.c b/crypto/mem_dbg.c
index 402df01fad..dee1fb98f9 100644
--- a/crypto/mem_dbg.c
+++ b/crypto/mem_dbg.c
@@ -197,10 +197,10 @@ static CRYPTO_THREADID disabling_threadid;
static void app_info_free(APP_INFO *inf)
{
+ if (!inf)
+ return;
if (--(inf->references) <= 0) {
- if (inf->next != NULL) {
- app_info_free(inf->next);
- }
+ app_info_free(inf->next);
OPENSSL_free(inf);
}
}
@@ -559,8 +559,7 @@ void CRYPTO_dbg_free(void *addr, int before_p)
fprintf(stderr, "LEVITTE_DEBUG_MEM: [%5ld] - 0x%p (%d)\n",
mp->order, mp->addr, mp->num);
#endif
- if (mp->app_info != NULL)
- app_info_free(mp->app_info);
+ app_info_free(mp->app_info);
OPENSSL_free(mp);
}
@@ -763,10 +762,8 @@ void CRYPTO_mem_leaks(BIO *b)
old_mh_mode = mh_mode;
mh_mode = CRYPTO_MEM_CHECK_OFF;
- if (mh != NULL) {
- lh_MEM_free(mh);
- mh = NULL;
- }
+ lh_MEM_free(mh);
+ mh = NULL;
if (amih != NULL) {
if (lh_APP_INFO_num_items(amih) == 0) {
lh_APP_INFO_free(amih);