]> granicus.if.org Git - libevent/commitdiff
Fix infrequent memory leak in bufferevent_init_common().
authorJardel Weyrich <jweyrich@gmail.com>
Fri, 12 Mar 2010 09:04:56 +0000 (06:04 -0300)
committerNick Mathewson <nickm@torproject.org>
Sun, 21 Mar 2010 17:34:32 +0000 (13:34 -0400)
bufferevent.c

index 350d44db1609b675ed6e66b2c56f6468a07d9e9c..1b6df74efdb675e6dbd5aaf8329209d152bab713 100644 (file)
@@ -267,6 +267,10 @@ bufferevent_init_common(struct bufferevent_private *bufev_private,
        if (options & BEV_OPT_THREADSAFE) {
                if (bufferevent_enable_locking(bufev, NULL) < 0) {
                        /* cleanup */
+                       evbuffer_free(bufev->input);
+                       evbuffer_free(bufev->output);
+                       bufev->input = NULL;
+                       bufev->output = NULL;
                        return -1;
                }
        }