diff options
author | Rich Salz <rsalz@openssl.org> | 2015-03-24 07:52:24 -0400 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2015-03-24 07:52:24 -0400 |
commit | 0dfb9398bb6493d5a56216e0c7039cb3f9fc88c6 (patch) | |
tree | 9ffaa0bec3d0f14092948174eeea90dc8e2ee7c4 /crypto/asn1/a_utctm.c | |
parent | 7c82e339a677f8546e1456c7a8f6788598a9de43 (diff) | |
download | openssl-0dfb9398bb6493d5a56216e0c7039cb3f9fc88c6.tar.gz |
free NULL cleanup
Start ensuring all OpenSSL "free" routines allow NULL, and remove
any if check before calling them.
This gets ASN1_OBJECT_free and ASN1_STRING_free.
Reviewed-by: Matt Caswell <matt@openssl.org>
Diffstat (limited to 'crypto/asn1/a_utctm.c')
-rw-r--r-- | crypto/asn1/a_utctm.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crypto/asn1/a_utctm.c b/crypto/asn1/a_utctm.c index 2dac3b58b4..0e2f1b0c40 100644 --- a/crypto/asn1/a_utctm.c +++ b/crypto/asn1/a_utctm.c @@ -193,11 +193,11 @@ ASN1_UTCTIME *ASN1_UTCTIME_adj(ASN1_UTCTIME *s, time_t t, int free_s = 0; if (s == NULL) { - free_s = 1; s = ASN1_UTCTIME_new(); + if (s == NULL) + goto err; + free_s = 1; } - if (s == NULL) - goto err; ts = OPENSSL_gmtime(&t, &data); if (ts == NULL) @@ -233,7 +233,7 @@ ASN1_UTCTIME *ASN1_UTCTIME_adj(ASN1_UTCTIME *s, time_t t, #endif return (s); err: - if (free_s && s) + if (free_s) ASN1_UTCTIME_free(s); return NULL; } |