From: Tobias Stoeckmann Date: Mon, 3 Oct 2016 20:05:46 +0000 (+0200) Subject: rev: Avoid calling free in a signal handler X-Git-Tag: v2.29-rc2~16 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2571cf0f9bfa769bdf9c8fba25684fa0330a2b57;p=thirdparty%2Futil-linux.git rev: Avoid calling free in a signal handler free() is not a safe function for a signal handler. The next line calls _exit() anyway, so there is no need for resource management. --- diff --git a/text-utils/rev.c b/text-utils/rev.c index cb38482413..ace2cd6a6b 100644 --- a/text-utils/rev.c +++ b/text-utils/rev.c @@ -68,7 +68,6 @@ wchar_t *buf; static void sig_handler(int signo __attribute__ ((__unused__))) { - free(buf); _exit(EXIT_SUCCESS); }