diff options
| author | beck <> | 2015-07-16 15:24:41 +0000 |
|---|---|---|
| committer | beck <> | 2015-07-16 15:24:41 +0000 |
| commit | 5c9eae5b27bdee7ec58ece155a53c9851f9a56a7 (patch) | |
| tree | 77406cddb11be26a2ec36668c8dd2dafe946d893 /src/usr.bin/openssl/engine.c | |
| parent | cabde351ec4e7188970dd4086e34c2d6826dd90b (diff) | |
| download | openbsd-5c9eae5b27bdee7ec58ece155a53c9851f9a56a7.tar.gz openbsd-5c9eae5b27bdee7ec58ece155a53c9851f9a56a7.tar.bz2 openbsd-5c9eae5b27bdee7ec58ece155a53c9851f9a56a7.zip | |
fix coverity leak - ID 78921
ok miod@, bcook@
Diffstat (limited to 'src/usr.bin/openssl/engine.c')
| -rw-r--r-- | src/usr.bin/openssl/engine.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/usr.bin/openssl/engine.c b/src/usr.bin/openssl/engine.c index e1f8d0d997..faf23fcd19 100644 --- a/src/usr.bin/openssl/engine.c +++ b/src/usr.bin/openssl/engine.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: engine.c,v 1.3 2015/02/08 10:22:45 doug Exp $ */ | 1 | /* $OpenBSD: engine.c,v 1.4 2015/07/16 15:24:41 beck Exp $ */ |
| 2 | /* Written by Richard Levitte <richard@levitte.org> for the OpenSSL | 2 | /* Written by Richard Levitte <richard@levitte.org> for the OpenSSL |
| 3 | * project 2000. | 3 | * project 2000. |
| 4 | */ | 4 | */ |
| @@ -457,7 +457,14 @@ skip_arg_loop: | |||
| 457 | if (ENGINE_init(e)) { | 457 | if (ENGINE_init(e)) { |
| 458 | BIO_printf(bio_out, "[ available ]\n"); | 458 | BIO_printf(bio_out, "[ available ]\n"); |
| 459 | util_do_cmds(e, post_cmds, bio_out, indent); | 459 | util_do_cmds(e, post_cmds, bio_out, indent); |
| 460 | ENGINE_finish(e); | 460 | /* |
| 461 | * XXX hell lacks a place for people who write functions with | ||
| 462 | * XXX unusable return semantics. | ||
| 463 | */ | ||
| 464 | if (ENGINE_finish(e) != 0 || | ||
| 465 | ERR_GET_REASON(ERR_peek_last_error()) == | ||
| 466 | ENGINE_R_FINISH_FAILED) | ||
| 467 | e = NULL; | ||
| 461 | } else { | 468 | } else { |
| 462 | BIO_printf(bio_out, "[ unavailable ]\n"); | 469 | BIO_printf(bio_out, "[ unavailable ]\n"); |
| 463 | if (test_avail_noise) | 470 | if (test_avail_noise) |
| @@ -465,7 +472,8 @@ skip_arg_loop: | |||
| 465 | ERR_clear_error(); | 472 | ERR_clear_error(); |
| 466 | } | 473 | } |
| 467 | } | 474 | } |
| 468 | if ((verbose > 0) && !util_verbose(e, verbose, bio_out, indent)) | 475 | if ((verbose > 0) && e != NULL && |
| 476 | !util_verbose(e, verbose, bio_out, indent)) | ||
| 469 | goto end; | 477 | goto end; |
| 470 | ENGINE_free(e); | 478 | ENGINE_free(e); |
| 471 | } else | 479 | } else |
