Fixed resource leak in __read_hostapd_config() 62/158462/1 accepted/tizen/unified/20171102.061546 submit/tizen/20171101.073548
authorNishant Chaprana <n.chaprana@samsung.com>
Wed, 1 Nov 2017 06:59:09 +0000 (12:29 +0530)
committerNishant Chaprana <n.chaprana@samsung.com>
Wed, 1 Nov 2017 06:59:59 +0000 (12:29 +0530)
Change-Id: Ifee5845e3dbed698087b8339ac419f1301d45a11
Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
packaging/wifi-mesh-manager.spec
src/wmesh-softap.c

index 1eb8997..3a5e2c8 100644 (file)
@@ -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
index 296f7ce..b14f946 100644 (file)
@@ -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;
 }