X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=netatalk.git;a=blobdiff_plain;f=libevent%2Fepoll.c;h=4c5c3da01a5bb2a8c4ee0a5267ebf66db589d10d;hp=2d4aebfbdd3169d74dc04dc8c8933746d180c867;hb=3a84db87064922ad10ac10cc1d6833380e575995;hpb=b0bcb8f6b0571592a50ce039882c9319e012a270 diff --git a/libevent/epoll.c b/libevent/epoll.c index 2d4aebfb..4c5c3da0 100644 --- a/libevent/epoll.c +++ b/libevent/epoll.c @@ -1,6 +1,6 @@ /* * Copyright 2000-2007 Niels Provos - * Copyright 2007-2010 Niels Provos, Nick Mathewson + * Copyright 2007-2012 Niels Provos, Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -120,8 +120,10 @@ epoll_init(struct event_base *base) evutil_make_socket_closeonexec(epfd); - if (!(epollop = mm_calloc(1, sizeof(struct epollop)))) + if (!(epollop = mm_calloc(1, sizeof(struct epollop)))) { + close(epfd); return (NULL); + } epollop->epfd = epfd; @@ -129,6 +131,7 @@ epoll_init(struct event_base *base) epollop->events = mm_calloc(INITIAL_NEVENT, sizeof(struct epoll_event)); if (epollop->events == NULL) { mm_free(epollop); + close(epfd); return (NULL); } epollop->nevents = INITIAL_NEVENT;