]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
rev: Avoid calling free in a signal handler
authorTobias Stoeckmann <tobias@stoeckmann.org>
Mon, 3 Oct 2016 20:05:46 +0000 (22:05 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 6 Oct 2016 12:56:39 +0000 (14:56 +0200)
free() is not a safe function for a signal handler. The next
line calls _exit() anyway, so there is no need for resource
management.

text-utils/rev.c

index cb384824138323a90dcdd0ba6cce720a5461792d..ace2cd6a6bc29bd460b3613422b4ff98a3d8e1f9 100644 (file)
@@ -68,7 +68,6 @@ wchar_t *buf;
 
 static void sig_handler(int signo __attribute__ ((__unused__)))
 {
-       free(buf);
        _exit(EXIT_SUCCESS);
 }