From: Taejeong Lee Date: Mon, 14 Jan 2013 04:43:04 +0000 (+0900) Subject: [Prevent] Fixed prevent issues X-Git-Tag: 2.1b_release~22^2~105 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=eeffaab8ae37124a090c92e0788d35c7fdf37d5d;p=platform%2Fframework%2Fweb%2Fwrt.git [Prevent] Fixed prevent issues [Issue#] prevent - #14493 [Bug] Resource leak (RESOURCE_LEAK) [Cause] Bug. [Solution] Release unhandled resource. Change-Id: Ib52dcf3cb5aa2e8e4b5e241ce00e954e2bb7611e --- diff --git a/src/wrt-launchpad-daemon/src/app_sock.c b/src/wrt-launchpad-daemon/src/app_sock.c index 0e74b93..44bb556 100644 --- a/src/wrt-launchpad-daemon/src/app_sock.c +++ b/src/wrt-launchpad-daemon/src/app_sock.c @@ -82,6 +82,7 @@ int __create_server_sock(int pid) /* or permission error by using 'emulator', bypass*/ if((errno != EOPNOTSUPP) && (errno != EPERM)) { _E("labeling to socket(IPOUT) error"); + close(fd); return -1; } } @@ -90,6 +91,7 @@ int __create_server_sock(int pid) /* or permission error by using 'emulator', bypass*/ if((errno != EOPNOTSUPP) && (errno != EPERM)) { _E("labeling to socket(IPIN) error"); + close(fd); return -1; } } @@ -97,12 +99,14 @@ int __create_server_sock(int pid) if (bind(fd, (struct sockaddr *)&saddr, sizeof(saddr)) < 0) { _E("bind error"); + close(fd); return -1; } if (chmod(saddr.sun_path, (S_IRWXU | S_IRWXG | S_IRWXO)) < 0) { /* Flawfinder: ignore*/ _E("failed to change the socket permission"); + close(fd); return -1; }