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_int.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_int.c')
-rw-r--r-- | src/lib/libcrypto/asn1/f_int.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/lib/libcrypto/asn1/f_int.c b/src/lib/libcrypto/asn1/f_int.c index 3f671d1c49..41e0e75226 100644 --- a/src/lib/libcrypto/asn1/f_int.c +++ b/src/lib/libcrypto/asn1/f_int.c | |||
@@ -162,8 +162,6 @@ a2i_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *bs, char *buf, int size) | |||
162 | if (sp == NULL) { | 162 | if (sp == NULL) { |
163 | ASN1err(ASN1_F_A2I_ASN1_INTEGER, | 163 | ASN1err(ASN1_F_A2I_ASN1_INTEGER, |
164 | ERR_R_MALLOC_FAILURE); | 164 | ERR_R_MALLOC_FAILURE); |
165 | if (s != NULL) | ||
166 | free(s); | ||
167 | goto err; | 165 | goto err; |
168 | } | 166 | } |
169 | s = sp; | 167 | s = sp; |
@@ -195,12 +193,11 @@ a2i_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *bs, char *buf, int size) | |||
195 | } | 193 | } |
196 | bs->length = num; | 194 | bs->length = num; |
197 | bs->data = s; | 195 | bs->data = s; |
198 | ret = 1; | 196 | return (1); |
199 | 197 | ||
200 | err: | ||
201 | if (0) { | ||
202 | err_sl: | 198 | err_sl: |
203 | ASN1err(ASN1_F_A2I_ASN1_INTEGER, ASN1_R_SHORT_LINE); | 199 | ASN1err(ASN1_F_A2I_ASN1_INTEGER, ASN1_R_SHORT_LINE); |
204 | } | 200 | err: |
201 | free(s); | ||
205 | return (ret); | 202 | return (ret); |
206 | } | 203 | } |