Add a file path to check mac address 16/102216/1
authorhyunuktak <hyunuk.tak@samsung.com>
Mon, 5 Dec 2016 07:49:14 +0000 (16:49 +0900)
committerhyunuktak <hyunuk.tak@samsung.com>
Mon, 5 Dec 2016 07:52:05 +0000 (16:52 +0900)
Fix build error for common 64bit Emulator
Fix a svace for memory leak

Change-Id: I7f63817d5bc6492e514dd6bfd81b8709f5a75727
Signed-off-by: hyunuktak <hyunuk.tak@samsung.com>
packaging/net-config.spec
src/utils/util.c
src/wifi-config.c

index f3841659ae1b72a4d82e80f8cfecbe404588f838..01b2f005f549f667d6da7420882a79f0d384ef79 100755 (executable)
@@ -1,6 +1,6 @@
 Name:          net-config
 Summary:       TIZEN Network Configuration service
-Version:       1.1.94
+Version:       1.1.96
 Release:       2
 Group:         System/Network
 License:       Apache-2.0
@@ -82,6 +82,9 @@ mkdir -p %{buildroot}%{_unitdir}
 cp resources/usr/lib/systemd/system/net-config_tv.service %{buildroot}%{_libdir}/systemd/system/net-config.service
 mkdir -p %{buildroot}%{_libdir}/udev/rules.d/
 cp resources/usr/lib/udev/rules.d/99-wifiusb-dev.rules %{buildroot}%{_libdir}/udev/rules.d/99-wifiusb-dev.rules
+%if "%{?_lib}" == "lib64"
+cp resources/usr/lib/systemd/system/net-config_tv.service %{buildroot}%{_unitdir}/net-config.service
+%endif
 %else
 cp resources/usr/lib/systemd/system/net-config.service %{buildroot}%{_libdir}/systemd/system/net-config.service
 %if "%{?_lib}" == "lib64"
index 8376291ce2bda852805e5350972e373e521a4fa6..f1c42f4ca7205e4cc140e6d89e62cc1e9d014edc 100755 (executable)
@@ -46,6 +46,7 @@
 #define DBUS_SERVICE_DBUS              "org.freedesktop.DBus"
 #define DBUS_INTERFACE_DBUS            "org.freedesktop.DBus"
 #define MAC_INFO_FILEPATH              tzplatform_mkpath(TZ_SYS_ETC, "/.mac.info")
+#define MAC_ADDRESS_FILEPATH   "/sys/class/net/wlan0/address"
 #define MAC_ADDRESS_MAX_LEN            18
 
 static gboolean netconfig_device_picker_test = FALSE;
@@ -1054,7 +1055,11 @@ void netconfig_set_mac_address_from_file(void)
        file = fopen(MAC_INFO_FILEPATH, "r");
        if (file == NULL) {
                ERR("Fail to open %s", MAC_INFO_FILEPATH);
-               return;
+               file = fopen(MAC_ADDRESS_FILEPATH, "r");
+               if (file == NULL) {
+                       ERR("Fail to open %s", MAC_ADDRESS_FILEPATH);
+                       return;
+               }
        }
        if (fgets(mac_str, sizeof(mac_str), file) == NULL) {
                ERR("Fail to read mac address");
index 1c590dd7df374f568939273bc0724b518660f155..9a910e8234f2f72517e8d8e8bd3810d96863d29d 100755 (executable)
@@ -217,9 +217,10 @@ static GKeyFile *__get_configuration_keyfile(const gchar *group_name)
        keyfile = netconfig_keyfile_load(path);
        if (keyfile == NULL) {
                ERR("keyfile[%s] is NULL", path);
-               g_free(path);
        }
 
+       g_free(path);
+
        return keyfile;
 }