summaryrefslogtreecommitdiff
path: root/lib/libcrypto/x509
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2014-05-30 02:52:12 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2014-05-30 02:52:12 +0000
commit890019d42bea9ea72b2a114957766c9c1b3cb7e3 (patch)
treedb57e71a5688e5229112337dcc33ca76da88d600 /lib/libcrypto/x509
parent8e9c3c8ab205533cebb588280a86d9ff2ec73fa2 (diff)
no need for null check before free. from Brendan MacDonell
Diffstat (limited to 'lib/libcrypto/x509')
-rw-r--r--lib/libcrypto/x509/by_dir.c3
-rw-r--r--lib/libcrypto/x509/x509_vpm.c3
2 files changed, 2 insertions, 4 deletions
diff --git a/lib/libcrypto/x509/by_dir.c b/lib/libcrypto/x509/by_dir.c
index fdfca6140ad..554f6600dc9 100644
--- a/lib/libcrypto/x509/by_dir.c
+++ b/lib/libcrypto/x509/by_dir.c
@@ -184,8 +184,7 @@ by_dir_hash_cmp(const BY_DIR_HASH * const *a,
static void
by_dir_entry_free(BY_DIR_ENTRY *ent)
{
- if (ent->dir)
- free(ent->dir);
+ free(ent->dir);
if (ent->hashes)
sk_BY_DIR_HASH_pop_free(ent->hashes, by_dir_hash_free);
free(ent);
diff --git a/lib/libcrypto/x509/x509_vpm.c b/lib/libcrypto/x509/x509_vpm.c
index c2cebd936fc..3ee3116ac17 100644
--- a/lib/libcrypto/x509/x509_vpm.c
+++ b/lib/libcrypto/x509/x509_vpm.c
@@ -212,8 +212,7 @@ X509_VERIFY_PARAM_set1(X509_VERIFY_PARAM *to, const X509_VERIFY_PARAM *from)
int
X509_VERIFY_PARAM_set1_name(X509_VERIFY_PARAM *param, const char *name)
{
- if (param->name)
- free(param->name);
+ free(param->name);
param->name = BUF_strdup(name);
if (param->name)
return 1;