summaryrefslogtreecommitdiffstats
path: root/crypto/x509/by_dir.c
diff options
context:
space:
mode:
authorRich Salz <rsalz@openssl.org>2015-05-01 14:37:16 -0400
committerRich Salz <rsalz@openssl.org>2015-05-01 14:37:16 -0400
commit25aaa98aa249d26391c1994d2de449562c8b8b99 (patch)
tree6f83efd87fa9fd832e8a456e9686143a29f1dab3 /crypto/x509/by_dir.c
parent666964780a245c14e8f0eb6e13dd854a37387ea9 (diff)
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/x509/by_dir.c')
-rw-r--r--crypto/x509/by_dir.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/crypto/x509/by_dir.c b/crypto/x509/by_dir.c
index 31b3c3c9dc..304cf4ab5c 100644
--- a/crypto/x509/by_dir.c
+++ b/crypto/x509/by_dir.c
@@ -177,8 +177,7 @@ static int by_dir_hash_cmp(const BY_DIR_HASH *const *a,
static void by_dir_entry_free(BY_DIR_ENTRY *ent)
{
OPENSSL_free(ent->dir);
- if (ent->hashes)
- sk_BY_DIR_HASH_pop_free(ent->hashes, by_dir_hash_free);
+ sk_BY_DIR_HASH_pop_free(ent->hashes, by_dir_hash_free);
OPENSSL_free(ent);
}
@@ -187,10 +186,8 @@ static void free_dir(X509_LOOKUP *lu)
BY_DIR *a;
a = (BY_DIR *)lu->method_data;
- if (a->dirs != NULL)
- sk_BY_DIR_ENTRY_pop_free(a->dirs, by_dir_entry_free);
- if (a->buffer != NULL)
- BUF_MEM_free(a->buffer);
+ sk_BY_DIR_ENTRY_pop_free(a->dirs, by_dir_entry_free);
+ BUF_MEM_free(a->buffer);
OPENSSL_free(a);
}
@@ -435,7 +432,6 @@ static int get_cert_by_subject(X509_LOOKUP *xl, int type, X509_NAME *name,
}
}
finish:
- if (b != NULL)
- BUF_MEM_free(b);
+ BUF_MEM_free(b);
return (ok);
}