X-Git-Url: https://git.openssl.org/?p=openssl.git;a=blobdiff_plain;f=crypto%2Fasn1%2Fa_utctm.c;h=0e2f1b0c40b506c2331536ac15f8ba9ef5b5139e;hp=2dac3b58b4c629063cc6638c602c7d839cb1e4aa;hb=0dfb9398bb6493d5a56216e0c7039cb3f9fc88c6;hpb=7c82e339a677f8546e1456c7a8f6788598a9de43 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; }