]> granicus.if.org Git - libevent/commitdiff
listener: unlock lev on error in listener_read_cb()
authorAzat Khuzhin <a3at.mail@gmail.com>
Thu, 31 Mar 2016 17:45:47 +0000 (20:45 +0300)
committerAzat Khuzhin <a3at.mail@gmail.com>
Thu, 31 Mar 2016 21:04:35 +0000 (00:04 +0300)
Without this patch:
  $ regress --no-fork +listener/error_unlock
  listener/error_unlock: [warn] Error from accept() call: Too many open files
  [err] ../evthread.c:220: Assertion lock->count == 0 failed in ../evthread.c
  Aborted (core dumped)

Fixes: #341
Fixes: listener/error_unlock
listener.c

index 2af14e3a7b54aad9cb037b29f7f95de7c142d9d9..2862d32e38d0335c218e7ce8defc23a7911a8126 100644 (file)
@@ -442,6 +442,7 @@ listener_read_cb(evutil_socket_t fd, short what, void *p)
                listener_decref_and_unlock(lev);
        } else {
                event_sock_warn(fd, "Error from accept() call");
+               UNLOCK(lev);
        }
 }