]> granicus.if.org Git - libevent/commitdiff
fix memleak in evmap_signal_clear; from Alexander Drozdov
authorNiels Provos <provos@gmail.com>
Mon, 26 Jan 2009 06:13:24 +0000 (06:13 +0000)
committerNiels Provos <provos@gmail.com>
Mon, 26 Jan 2009 06:13:24 +0000 (06:13 +0000)
svn:r1049

evmap.c

diff --git a/evmap.c b/evmap.c
index ec312dc651407fffa9952fcbc42db105327cd88b..ee04639a6742cc023094befc75d21fa85c237139 100644 (file)
--- a/evmap.c
+++ b/evmap.c
@@ -228,7 +228,6 @@ evmap_signal_initmap(struct event_signal_map *ctx)
 void
 evmap_signal_clear(struct event_signal_map *ctx)
 {
-       ctx->nentries = 0;
        if (ctx->entries != NULL) {
                int i;
                for (i = 0; i < ctx->nentries; ++i) {
@@ -238,6 +237,7 @@ evmap_signal_clear(struct event_signal_map *ctx)
                mm_free(ctx->entries);
                ctx->entries = NULL;
        }
+       ctx->nentries = 0;
 }