projects
/
platform
/
core
/
connectivity
/
net-config.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix some svace issues for memory leak and checking return value
[platform/core/connectivity/net-config.git]
/
src
/
wifi-power.c
diff --git
a/src/wifi-power.c
b/src/wifi-power.c
index
71e9530
..
947716f
100755
(executable)
--- a/
src/wifi-power.c
+++ b/
src/wifi-power.c
@@
-307,11
+307,19
@@
static void __netconfig_set_wifi_bssid(void)
return;
}
return;
}
- fseek(fp, 0L, SEEK_SET);
- rv = fscanf(fp, "%17s", bssid);
+ rv = fseek(fp, 0L, SEEK_SET);
+ if (rv != 0) {
+ ERR("Fail to seek file");
+ fclose(fp);
+ return;
+ }
- if (rv < 0)
+ rv = fscanf(fp, "%17s", bssid);
+ if (rv < 0) {
ERR("Fail to read bssid");
ERR("Fail to read bssid");
+ fclose(fp);
+ return;
+ }
netconfig_set_vconf_str(VCONF_WIFI_BSSID_ADDRESS, bssid);
netconfig_set_vconf_str(VCONF_WIFI_BSSID_ADDRESS, bssid);