From: FdaSilvaYY Date: Sun, 7 Oct 2018 19:47:31 +0000 (+0200) Subject: Coverity fix in apps/oscp X-Git-Tag: OpenSSL_1_1_1b~111 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=9318545c2859d89c4496240649ab2f322dbd3ad8;p=oweals%2Fopenssl.git Coverity fix in apps/oscp CID 1440002 (#1 of 1): Use after free (USE_AFTER_FREE) Not a deadly error, because error was just before app exit. Reviewed-by: Richard Levitte Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/7359) (cherry picked from commit 39fc4c17c49d248e0757bac9aa8863d205c7ad12) --- diff --git a/apps/ocsp.c b/apps/ocsp.c index 7fd78624bb..de95b71ccf 100644 --- a/apps/ocsp.c +++ b/apps/ocsp.c @@ -863,6 +863,7 @@ static void killall(int ret, pid_t *kidpids) for (i = 0; i < multi; ++i) if (kidpids[i] != 0) (void)kill(kidpids[i], SIGTERM); + OPENSSL_free(kidpids); sleep(1); exit(ret); } @@ -977,7 +978,6 @@ 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); }