diff options
Diffstat (limited to 'lib/libcrypto/asn1')
-rw-r--r-- | lib/libcrypto/asn1/f_enum.c | 11 | ||||
-rw-r--r-- | lib/libcrypto/asn1/f_int.c | 11 | ||||
-rw-r--r-- | lib/libcrypto/asn1/f_string.c | 11 |
3 files changed, 12 insertions, 21 deletions
diff --git a/lib/libcrypto/asn1/f_enum.c b/lib/libcrypto/asn1/f_enum.c index 98fa3122661..5c42cdff015 100644 --- a/lib/libcrypto/asn1/f_enum.c +++ b/lib/libcrypto/asn1/f_enum.c @@ -158,8 +158,6 @@ a2i_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *bs, char *buf, int size) if (sp == NULL) { ASN1err(ASN1_F_A2I_ASN1_ENUMERATED, ERR_R_MALLOC_FAILURE); - if (s != NULL) - free(s); goto err; } s = sp; @@ -191,12 +189,11 @@ a2i_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *bs, char *buf, int size) } bs->length = num; bs->data = s; - ret = 1; + return (1); -err: - if (0) { err_sl: - ASN1err(ASN1_F_A2I_ASN1_ENUMERATED, ASN1_R_SHORT_LINE); - } + ASN1err(ASN1_F_A2I_ASN1_ENUMERATED, ASN1_R_SHORT_LINE); +err: + free(s); return (ret); } diff --git a/lib/libcrypto/asn1/f_int.c b/lib/libcrypto/asn1/f_int.c index 3f671d1c490..41e0e752264 100644 --- a/lib/libcrypto/asn1/f_int.c +++ b/lib/libcrypto/asn1/f_int.c @@ -162,8 +162,6 @@ a2i_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *bs, char *buf, int size) if (sp == NULL) { ASN1err(ASN1_F_A2I_ASN1_INTEGER, ERR_R_MALLOC_FAILURE); - if (s != NULL) - free(s); goto err; } s = sp; @@ -195,12 +193,11 @@ a2i_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *bs, char *buf, int size) } bs->length = num; bs->data = s; - ret = 1; + return (1); -err: - if (0) { err_sl: - ASN1err(ASN1_F_A2I_ASN1_INTEGER, ASN1_R_SHORT_LINE); - } + ASN1err(ASN1_F_A2I_ASN1_INTEGER, ASN1_R_SHORT_LINE); +err: + free(s); return (ret); } diff --git a/lib/libcrypto/asn1/f_string.c b/lib/libcrypto/asn1/f_string.c index c213c7a88d3..14f6554ab33 100644 --- a/lib/libcrypto/asn1/f_string.c +++ b/lib/libcrypto/asn1/f_string.c @@ -154,8 +154,6 @@ a2i_ASN1_STRING(BIO *bp, ASN1_STRING *bs, char *buf, int size) if (sp == NULL) { ASN1err(ASN1_F_A2I_ASN1_STRING, ERR_R_MALLOC_FAILURE); - if (s != NULL) - free(s); goto err; } s = sp; @@ -187,12 +185,11 @@ a2i_ASN1_STRING(BIO *bp, ASN1_STRING *bs, char *buf, int size) } bs->length = num; bs->data = s; - ret = 1; + return (1); -err: - if (0) { err_sl: - ASN1err(ASN1_F_A2I_ASN1_STRING, ASN1_R_SHORT_LINE); - } + ASN1err(ASN1_F_A2I_ASN1_STRING, ASN1_R_SHORT_LINE); +err: + free(s); return (ret); } |