summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2018-10-01 12:06:06 +0100
committerMatt Caswell <matt@openssl.org>2018-10-02 10:52:57 +0100
commitc20a76f695922f409c316399f7290530f7728f19 (patch)
tree904ca1ca5252def1aefedae5bcc793f69b49d337 /apps
parentf3002a2ed3645d8d6e1511424b3f5e89f6117edf (diff)
Fix a mem leak in the ocsp app
Free memory allocated in the parent process that is not needed in the child. We also free it in the parent. Technically this isn't really required since we end up calling exit() soon afterwards - but to prevent false positives we free it anyway. Fixes a Coverity issue. Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/7335)
Diffstat (limited to 'apps')
-rw-r--r--apps/ocsp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/apps/ocsp.c b/apps/ocsp.c
index eb822c2696..7fd78624bb 100644
--- a/apps/ocsp.c
+++ b/apps/ocsp.c
@@ -950,6 +950,7 @@ static void spawn_loop(void)
sleep(30);
break;
case 0: /* child */
+ OPENSSL_free(kidpids);
signal(SIGINT, SIG_DFL);
signal(SIGTERM, SIG_DFL);
if (termsig)
@@ -976,6 +977,7 @@ static void spawn_loop(void)
}
/* The loop above can only break on termsig */
+ OPENSSL_free(kidpids);
syslog(LOG_INFO, "terminating on signal: %d", termsig);
killall(0, kidpids);
}