From: Volodymyr Brynza Date: Wed, 14 Dec 2016 12:32:26 +0000 (+0200) Subject: Fix fd leak X-Git-Tag: submit/tizen_3.0/20161220.100802^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b6a583e98aaa2b09fb2d54dbf198684831d82694;p=platform%2Fupstream%2Fmurphy.git Fix fd leak Change-Id: Ib2f8153d2a8e13bc8f0edf6cbbc2ecf3de274044 Signed-off-by: Volodymyr Brynza --- diff --git a/src/common/socket-utils.c b/src/common/socket-utils.c index 4f7d957..236ba91 100644 --- a/src/common/socket-utils.c +++ b/src/common/socket-utils.c @@ -99,3 +99,9 @@ int mrp_reject_connection(int sock, struct sockaddr *addr, socklen_t *alen) return (fd >= 0 ? 0 : -1); } + +MRP_EXIT static void mrp_close_reserved_fd() +{ + if (reject_fd > 0) + close(reject_fd); +}