From: Tobias Ulmer Date: Wed, 15 Jan 2014 19:16:52 +0000 (+0100) Subject: Fix use after free in poll X-Git-Tag: e2factory-2.3.15rc1~264 X-Git-Url: https://git.e2factory.org/?a=commitdiff_plain;h=e928176c3aabfdb580008619285c996326a216dd;p=e2factory.git Fix use after free in poll Been there since the beginning of (e2factory) time. Signed-off-by: Tobias Ulmer --- diff --git a/generic/le2lib.c b/generic/le2lib.c index 2105173..981f054 100644 --- a/generic/le2lib.c +++ b/generic/le2lib.c @@ -338,10 +338,10 @@ poll_fd(lua_State *lua) if (f > 0) { while (--nfds >= 0) { if (fds[nfds].revents) { - free(fds); lua_pushnumber(lua, nfds+1); lua_pushboolean(lua, fds[nfds].revents & POLLIN); lua_pushboolean(lua, fds[nfds].revents & POLLOUT); + free(fds); return 3; } }