summaryrefslogtreecommitdiffstats
path: root/crypto/txt_db
diff options
context:
space:
mode:
authorRich Salz <rsalz@openssl.org>2015-05-01 10:02:07 -0400
committerRich Salz <rsalz@openssl.org>2015-05-01 10:02:07 -0400
commitb548a1f11c06ccdfa4f52a539912d22d77ee309e (patch)
tree37ff8792ddf09e4805aa3ba76b805923d3c52734 /crypto/txt_db
parent33fbca83dcd05b77f807fab205c4523b8cfe85b5 (diff)
free null cleanup finale
Don't check for NULL before calling OPENSSL_free Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto/txt_db')
-rw-r--r--crypto/txt_db/txt_db.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/crypto/txt_db/txt_db.c b/crypto/txt_db/txt_db.c
index 7f0548fd88..029d0bb2fe 100644
--- a/crypto/txt_db/txt_db.c
+++ b/crypto/txt_db/txt_db.c
@@ -184,12 +184,9 @@ TXT_DB *TXT_DB_read(BIO *in, int num)
if (ret != NULL) {
if (ret->data != NULL)
sk_OPENSSL_PSTRING_free(ret->data);
- if (ret->index != NULL)
- OPENSSL_free(ret->index);
- if (ret->qual != NULL)
- OPENSSL_free(ret->qual);
- if (ret != NULL)
- OPENSSL_free(ret);
+ OPENSSL_free(ret->index);
+ OPENSSL_free(ret->qual);
+ OPENSSL_free(ret);
}
return (NULL);
} else
@@ -350,8 +347,7 @@ void TXT_DB_free(TXT_DB *db)
lh_OPENSSL_STRING_free(db->index[i]);
OPENSSL_free(db->index);
}
- if (db->qual != NULL)
- OPENSSL_free(db->qual);
+ OPENSSL_free(db->qual);
if (db->data != NULL) {
for (i = sk_OPENSSL_PSTRING_num(db->data) - 1; i >= 0; i--) {
/*
@@ -362,12 +358,10 @@ void TXT_DB_free(TXT_DB *db)
max = p[db->num_fields]; /* last address */
if (max == NULL) { /* new row */
for (n = 0; n < db->num_fields; n++)
- if (p[n] != NULL)
- OPENSSL_free(p[n]);
+ OPENSSL_free(p[n]);
} else {
for (n = 0; n < db->num_fields; n++) {
- if (((p[n] < (char *)p) || (p[n] > max))
- && (p[n] != NULL))
+ if (((p[n] < (char *)p) || (p[n] > max)))
OPENSSL_free(p[n]);
}
}