diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2001-06-19 19:13:48 +0200 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2001-06-19 19:13:48 +0200 |
commit | a45e4a5537e009761652db0d9aa1ef28b1ce8937 (patch) | |
tree | c6e6e0e1cb9aa428c65ef3a1c1e1236d55cc631e | |
parent | cp is only used when DSA is built. (diff) | |
download | openssl-a45e4a5537e009761652db0d9aa1ef28b1ce8937.tar.xz openssl-a45e4a5537e009761652db0d9aa1ef28b1ce8937.zip |
Fix memory leaks.
-rw-r--r-- | apps/engine.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/apps/engine.c b/apps/engine.c index 31221ed867..faeeb7e200 100644 --- a/apps/engine.c +++ b/apps/engine.c @@ -183,14 +183,12 @@ static int util_verbose(ENGINE *e, int verbose, BIO *bio_out, const char *indent { static const int line_wrap = 78; int num; + int ret = 0; char *name = NULL; char *desc = NULL; int flags; int xpos = 0; - STACK *cmds = sk_new_null(); - - if(!cmds) - goto err; + STACK *cmds = NULL; if(!ENGINE_ctrl(e, ENGINE_CTRL_HAS_CTRL_FUNCTION, 0, NULL, NULL) || ((num = ENGINE_ctrl(e, ENGINE_CTRL_GET_FIRST_CMD_TYPE, 0, NULL, NULL)) <= 0)) @@ -200,6 +198,11 @@ static int util_verbose(ENGINE *e, int verbose, BIO *bio_out, const char *indent #endif return 1; } + + cmds = sk_new_null(); + + if(!cmds) + goto err; do { int len; /* Get the command name */ @@ -264,12 +267,12 @@ static int util_verbose(ENGINE *e, int verbose, BIO *bio_out, const char *indent } while(num > 0); if(xpos > 0) BIO_printf(bio_out, "\n"); - return 1; + ret = 1; err: if(cmds) sk_pop_free(cmds, identity); if(name) OPENSSL_free(name); if(desc) OPENSSL_free(desc); - return 0; + return ret; } static void util_do_cmds(ENGINE *e, STACK *cmds, BIO *bio_out, const char *indent) |