From: Tobias Stoeckmann <tobias@stoeckmann.org>
To: util-linux@vger.kernel.org
Subject: [PATCH] rev: Avoid calling free in a signal handler
Date: Mon, 3 Oct 2016 22:05:46 +0200 [thread overview]
Message-ID: <20161003200546.GB2287@localhost> (raw)
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
next reply other threads:[~2016-10-03 20:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-03 20:05 Tobias Stoeckmann [this message]
2016-10-06 12:59 ` [PATCH] rev: Avoid calling free in a signal handler Karel Zak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161003200546.GB2287@localhost \
--to=tobias@stoeckmann.org \
--cc=util-linux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox