]> granicus.if.org Git - libevent/commitdiff
Fix locking in bufferevent_get_options_().
authorMaxime Henrion <mhenrion@appnexus.com>
Thu, 23 May 2013 16:31:53 +0000 (16:31 +0000)
committerNick Mathewson <nickm@torproject.org>
Fri, 24 May 2013 15:04:17 +0000 (11:04 -0400)
bufferevent.c

index f2f844389c7c0d89b6bc6d59660fd11f9c3253b3..3cd1ba6291f2047930534232cafda9799434b628 100644 (file)
@@ -825,10 +825,12 @@ bufferevent_get_options_(struct bufferevent *bev)
 {
        struct bufferevent_private *bev_p =
            EVUTIL_UPCAST(bev, struct bufferevent_private, bev);
+       enum bufferevent_options options;
 
        BEV_LOCK(bev);
-       return bev_p->options;
+       options = bev_p->options;
        BEV_UNLOCK(bev);
+       return options;
 }