diff options
author | tedu <> | 2014-04-22 20:31:57 +0000 |
---|---|---|
committer | tedu <> | 2014-04-22 20:31:57 +0000 |
commit | 8d02e1986f2643ed0c05cf3726840f3c5f2486cd (patch) | |
tree | d49a2fea9cd5182996558313f8631378315dad7c /src/lib/libcrypto/asn1/f_enum.c | |
parent | 1c26126a31b9d310c9fb3e33570fcbbe14676b11 (diff) | |
download | openbsd-8d02e1986f2643ed0c05cf3726840f3c5f2486cd.tar.gz openbsd-8d02e1986f2643ed0c05cf3726840f3c5f2486cd.tar.bz2 openbsd-8d02e1986f2643ed0c05cf3726840f3c5f2486cd.zip |
fix memory leaks. from Dirk Engling
Diffstat (limited to 'src/lib/libcrypto/asn1/f_enum.c')
-rw-r--r-- | src/lib/libcrypto/asn1/f_enum.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/lib/libcrypto/asn1/f_enum.c b/src/lib/libcrypto/asn1/f_enum.c index 98fa312266..5c42cdff01 100644 --- a/src/lib/libcrypto/asn1/f_enum.c +++ b/src/lib/libcrypto/asn1/f_enum.c | |||
@@ -158,8 +158,6 @@ a2i_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *bs, char *buf, int size) | |||
158 | if (sp == NULL) { | 158 | if (sp == NULL) { |
159 | ASN1err(ASN1_F_A2I_ASN1_ENUMERATED, | 159 | ASN1err(ASN1_F_A2I_ASN1_ENUMERATED, |
160 | ERR_R_MALLOC_FAILURE); | 160 | ERR_R_MALLOC_FAILURE); |
161 | if (s != NULL) | ||
162 | free(s); | ||
163 | goto err; | 161 | goto err; |
164 | } | 162 | } |
165 | s = sp; | 163 | s = sp; |
@@ -191,12 +189,11 @@ a2i_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *bs, char *buf, int size) | |||
191 | } | 189 | } |
192 | bs->length = num; | 190 | bs->length = num; |
193 | bs->data = s; | 191 | bs->data = s; |
194 | ret = 1; | 192 | return (1); |
195 | 193 | ||
196 | err: | ||
197 | if (0) { | ||
198 | err_sl: | 194 | err_sl: |
199 | ASN1err(ASN1_F_A2I_ASN1_ENUMERATED, ASN1_R_SHORT_LINE); | 195 | ASN1err(ASN1_F_A2I_ASN1_ENUMERATED, ASN1_R_SHORT_LINE); |
200 | } | 196 | err: |
197 | free(s); | ||
201 | return (ret); | 198 | return (ret); |
202 | } | 199 | } |