Free the allocated memory before return 41/258441/1 accepted/tizen/6.5/unified/20211028.095341 accepted/tizen/unified/20210602.122531 submit/tizen/20210531.063738 submit/tizen_6.5/20211028.161801 tizen_6.5.m2_release
authorCheoleun Moon <chleun.moon@samsung.com>
Tue, 18 May 2021 03:59:37 +0000 (12:59 +0900)
committerCheoleun Moon <chleun.moon@samsung.com>
Tue, 18 May 2021 03:59:43 +0000 (12:59 +0900)
Change-Id: I69bacec61e2fb50f037a558e2ef448c1a37a6932
Signed-off-by: Cheoleun Moon <chleun.moon@samsung.com>
src/tethering.c

index 4eab262..017550b 100755 (executable)
@@ -236,8 +236,10 @@ static bool __get_ssid_from_vconf(const char *path, char *ssid, unsigned int siz
        if (ptr == NULL)
                return false;
 
-       if (!g_strcmp0(ptr, ""))
+       if (!g_strcmp0(ptr, "")) {
+               free(ptr);
                return false;
+       }
 
        if (!g_utf8_validate(ptr, -1, (const char **)&ptr_tmp))
                *ptr_tmp = '\0';
@@ -5052,7 +5054,7 @@ API int tethering_wifi_is_sharing_supported(tethering_h tethering, bool *support
        parameters = g_dbus_proxy_call_sync(proxy, "get_wifi_interfaces",
                        NULL, G_DBUS_CALL_FLAGS_NONE, -1, NULL, &error);
 
-       if (!parameters && error) {
+       if (error) {
                ERR("g_dbus_proxy_call_sync failed because  %s\n", error->message);
 
                if (error->code == G_DBUS_ERROR_ACCESS_DENIED)