]> granicus.if.org Git - libevent/commitdiff
fix memory leak whens etting up priorities; reported by Alexander Drozdov
authorNiels Provos <provos@gmail.com>
Tue, 27 Jan 2009 16:29:48 +0000 (16:29 +0000)
committerNiels Provos <provos@gmail.com>
Tue, 27 Jan 2009 16:29:48 +0000 (16:29 +0000)
svn:r1061

event.c

diff --git a/event.c b/event.c
index 2539a7be41c45fd4e50b52c1a93b45f9beff0ab2..c3b4f3f10210c59e901e21c9d46aa4e0244a55d6 100644 (file)
--- a/event.c
+++ b/event.c
@@ -534,7 +534,10 @@ event_base_priority_init(struct event_base *base, int npriorities)
        if (base->event_count_active)
                return (-1);
 
-       if (base->nactivequeues && npriorities != base->nactivequeues) {
+       if (npriorities == base->nactivequeues)
+               return (0);
+
+       if (base->nactivequeues) {
                for (i = 0; i < base->nactivequeues; ++i) {
                        mm_free(base->activequeues[i]);
                }