From: Nishant Chaprana Date: Wed, 1 Nov 2017 06:59:09 +0000 (+0530) Subject: Fixed resource leak in __read_hostapd_config() X-Git-Tag: accepted/tizen/unified/20171102.061546^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a88663aaf9120d5965b6f3bf483e8307eb3d8706;p=platform%2Fcore%2Fconnectivity%2Fwifi-mesh-manager.git Fixed resource leak in __read_hostapd_config() Change-Id: Ifee5845e3dbed698087b8339ac419f1301d45a11 Signed-off-by: Nishant Chaprana --- diff --git a/packaging/wifi-mesh-manager.spec b/packaging/wifi-mesh-manager.spec index 1eb8997..3a5e2c8 100644 --- a/packaging/wifi-mesh-manager.spec +++ b/packaging/wifi-mesh-manager.spec @@ -2,7 +2,7 @@ Name: wifi-mesh-manager Summary: Wi-Fi mesh network daemon -Version: 0.0.1 +Version: 0.0.2 Release: 1 Group: Network & Connectivity/Wireless License: Apache-2.0 diff --git a/src/wmesh-softap.c b/src/wmesh-softap.c index 296f7ce..b14f946 100644 --- a/src/wmesh-softap.c +++ b/src/wmesh-softap.c @@ -197,8 +197,10 @@ static int __read_hostapd_config(char **softap_interface, char **ssid, } if (!softap_interface || !ssid || !security || !passphrase || !mode || - !channel || !visibility || !max_sta) + !channel || !visibility || !max_sta) { + fclose(fp); return WMESHD_ERROR_INVALID_PARAMETER; + } *security = 0; @@ -230,6 +232,7 @@ static int __read_hostapd_config(char **softap_interface, char **ssid, } } + fclose(fp); return WMESHD_ERROR_NONE; }