summaryrefslogtreecommitdiffstats
path: root/crypto/asn1/a_d2i_fp.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/asn1/a_d2i_fp.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/asn1/a_d2i_fp.c')
-rw-r--r--crypto/asn1/a_d2i_fp.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/crypto/asn1/a_d2i_fp.c b/crypto/asn1/a_d2i_fp.c
index af1f7c6f06..13e47fde08 100644
--- a/crypto/asn1/a_d2i_fp.c
+++ b/crypto/asn1/a_d2i_fp.c
@@ -97,8 +97,7 @@ void *ASN1_d2i_bio(void *(*xnew) (void), d2i_of_void *d2i, BIO *in, void **x)
p = (unsigned char *)b->data;
ret = d2i(x, &p, len);
err:
- if (b != NULL)
- BUF_MEM_free(b);
+ BUF_MEM_free(b);
return (ret);
}
@@ -118,8 +117,7 @@ void *ASN1_item_d2i_bio(const ASN1_ITEM *it, BIO *in, void *x)
p = (const unsigned char *)b->data;
ret = ASN1_item_d2i(x, &p, len, it);
err:
- if (b != NULL)
- BUF_MEM_free(b);
+ BUF_MEM_free(b);
return (ret);
}
@@ -264,7 +262,6 @@ static int asn1_d2i_read_bio(BIO *in, BUF_MEM **pb)
*pb = b;
return off;
err:
- if (b != NULL)
- BUF_MEM_free(b);
+ BUF_MEM_free(b);
return -1;
}