]> granicus.if.org Git - libevent/commitdiff
Do not free the signal index unless it was at some point allocated
authorNick Mathewson <nickm@torproject.org>
Tue, 21 Apr 2009 18:47:53 +0000 (18:47 +0000)
committerNick Mathewson <nickm@torproject.org>
Tue, 21 Apr 2009 18:47:53 +0000 (18:47 +0000)
svn:r1217

ChangeLog
signal.c

index c4b22eeccfd7cd232a3333c392871e43b07845c0..f9033d46150498bee6052c49f97423b5987b98c5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,8 @@
 Changes in 2.0.2-alpha:
  o Add a new flag to bufferevents to make all callbacks automatically deferred.
  o Make evdns functionality locked, and automatically defer dns callbacks.
-        
+ o Fix a possible free(NULL) when freeing an event_base with no signals.
+
 Changes in 2.0.1-alpha:
  o free minheap on event_base_free(); from Christopher Layne
  o debug cleanups in signal.c; from Christopher Layne
index 9313a8ae5ad9ca9583f435a75dfeb8296a44eefb..15f0dd01b40f7d968d86f6891bc9c3837570a44f 100644 (file)
--- a/signal.c
+++ b/signal.c
@@ -337,5 +337,6 @@ evsig_dealloc(struct event_base *base)
        base->sig.sh_old_max = 0;
 
        /* per index frees are handled in evsig_del() */
-       mm_free(base->sig.sh_old);
+       if (base->sig.sh_old)
+               mm_free(base->sig.sh_old);
 }