diff options
-rw-r--r-- | src/lib/libssl/src/apps/dsa.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/src/lib/libssl/src/apps/dsa.c b/src/lib/libssl/src/apps/dsa.c index af5702cf72..3dad04317f 100644 --- a/src/lib/libssl/src/apps/dsa.c +++ b/src/lib/libssl/src/apps/dsa.c | |||
@@ -266,7 +266,7 @@ bad: | |||
266 | passin, e, "Public Key"); | 266 | passin, e, "Public Key"); |
267 | else | 267 | else |
268 | pkey = load_key(bio_err, infile, informat, 1, | 268 | pkey = load_key(bio_err, infile, informat, 1, |
269 | passin, e, "Private Key"); | 269 | passin, e, "Private Key"); |
270 | 270 | ||
271 | if (pkey) { | 271 | if (pkey) { |
272 | dsa = EVP_PKEY_get1_DSA(pkey); | 272 | dsa = EVP_PKEY_get1_DSA(pkey); |
@@ -288,11 +288,12 @@ bad: | |||
288 | } | 288 | } |
289 | } | 289 | } |
290 | 290 | ||
291 | if (text) | 291 | if (text) { |
292 | if (!DSA_print(out, dsa, 0)) { | 292 | if (!DSA_print(out, dsa, 0)) { |
293 | perror(outfile); | 293 | perror(outfile); |
294 | ERR_print_errors(bio_err); | 294 | ERR_print_errors(bio_err); |
295 | goto end; | 295 | goto end; |
296 | } | ||
296 | } | 297 | } |
297 | 298 | ||
298 | if (modulus) { | 299 | if (modulus) { |
@@ -338,12 +339,17 @@ bad: | |||
338 | } else | 339 | } else |
339 | ret = 0; | 340 | ret = 0; |
340 | end: | 341 | end: |
341 | if (in != NULL) BIO_free(in); | 342 | if (in != NULL) |
342 | if (out != NULL) BIO_free_all(out); | 343 | BIO_free(in); |
343 | if (dsa != NULL) DSA_free(dsa); | 344 | if (out != NULL) |
344 | if (passin) free(passin); | 345 | BIO_free_all(out); |
345 | if (passout) free(passout); | 346 | if (dsa != NULL) |
346 | apps_shutdown(); | 347 | DSA_free(dsa); |
348 | if (passin) | ||
349 | free(passin); | ||
350 | if (passout) | ||
351 | free(passout); | ||
352 | apps_shutdown(); | ||
347 | OPENSSL_EXIT(ret); | 353 | OPENSSL_EXIT(ret); |
348 | } | 354 | } |
349 | #else /* !OPENSSL_NO_DSA */ | 355 | #else /* !OPENSSL_NO_DSA */ |