]> granicus.if.org Git - libevent/commitdiff
Fix a memory leak on win32 socket->event map.
authorNick Mathewson <nickm@torproject.org>
Thu, 21 Apr 2011 21:33:13 +0000 (17:33 -0400)
committerNick Mathewson <nickm@torproject.org>
Thu, 21 Apr 2011 21:33:13 +0000 (17:33 -0400)
This would lose some memory every time an event_base was freed on win32.

Found by Dimitre Piskyulev.

evmap.c

diff --git a/evmap.c b/evmap.c
index 5521626cf2431137f542c94d406801fef2833328..5167d7abfa2dd0873d2fb87490069a211045e6ee 100644 (file)
--- a/evmap.c
+++ b/evmap.c
@@ -148,6 +148,7 @@ void evmap_io_clear(struct event_io_map *ctx)
                next = HT_NEXT_RMV(event_io_map, ctx, ent);
                mm_free(this);
        }
+       HT_CLEAR(event_io_map, ctx); /* remove all storage held by the ctx. */
 }
 #endif