From fa95fe469aa666de53505f565bb69c8cd16ae6d8 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Sun, 25 Nov 2007 21:28:43 +0000 Subject: [PATCH] r16704@catbus: nickm | 2007-11-19 15:58:54 -0500 Check return value of event_add in signal.c svn:r546 --- ChangeLog | 1 + signal.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index cc698f47..314929c4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,7 @@ Changes in current version: o New function event_set_mem_functinons. It allows the user to give libevent replacement functions to use for memory management in place of malloc(), free(), etc. This should be generally useful for memory instrumentation, specialized allocators, and so on. o The kqueue implementation now catches signals that are raised after event_add() is called but before the event_loop() call. This makes it match the other implementations. o The kqueue implementation now restores original signal handlers correctly when its signal events are removed. + o Check return value of event_add in signal.c Changes in 1.4.0: diff --git a/signal.c b/signal.c index 60caef30..ae07850d 100644 --- a/signal.c +++ b/signal.c @@ -199,8 +199,9 @@ evsignal_add(struct event *ev) evsignal_base = base; if (!sig->ev_signal_added) { + if (event_add(&sig->ev_signal, NULL)) + return (-1); sig->ev_signal_added = 1; - event_add(&sig->ev_signal, NULL); } return (0);