Util-Linux package development
 help / color / mirror / Atom feed
* [PATCH] rev: Avoid calling free in a signal handler
@ 2016-10-03 20:05 Tobias Stoeckmann
  2016-10-06 12:59 ` Karel Zak
  0 siblings, 1 reply; 2+ messages in thread
From: Tobias Stoeckmann @ 2016-10-03 20:05 UTC (permalink / raw)
  To: util-linux

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 | 1 -
 1 file changed, 1 deletion(-)

diff --git a/text-utils/rev.c b/text-utils/rev.c
index cb38482..ace2cd6 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);
 }
 
-- 
2.10.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-10-06 12:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-03 20:05 [PATCH] rev: Avoid calling free in a signal handler Tobias Stoeckmann
2016-10-06 12:59 ` Karel Zak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox