diff options
author | 2014-04-22 20:31:57 +0000 | |
---|---|---|
committer | 2014-04-22 20:31:57 +0000 | |
commit | 368ec679405beffabfeeabeee86a82aa75606e99 (patch) | |
tree | d778b2ca72ca123b35c9dc3ff12c137bc0c0b2f1 /lib/libssl/src/crypto/asn1/f_string.c | |
parent | Remove meat which either duplicates code found in apps/, or is only of value (diff) | |
download | wireguard-openbsd-368ec679405beffabfeeabeee86a82aa75606e99.tar.xz wireguard-openbsd-368ec679405beffabfeeabeee86a82aa75606e99.zip |
fix memory leaks. from Dirk Engling
Diffstat (limited to 'lib/libssl/src/crypto/asn1/f_string.c')
-rw-r--r-- | lib/libssl/src/crypto/asn1/f_string.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/libssl/src/crypto/asn1/f_string.c b/lib/libssl/src/crypto/asn1/f_string.c index c213c7a88d3..14f6554ab33 100644 --- a/lib/libssl/src/crypto/asn1/f_string.c +++ b/lib/libssl/src/crypto/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); } |