From: Cheoleun Moon Date: Tue, 18 May 2021 03:59:37 +0000 (+0900) Subject: Free the allocated memory before return X-Git-Tag: accepted/tizen/6.5/unified/20211028.095341^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c3bf85017d7d1f7e687aae12d863b7f47b21d350;p=platform%2Fcore%2Fapi%2Ftethering.git Free the allocated memory before return Change-Id: I69bacec61e2fb50f037a558e2ef448c1a37a6932 Signed-off-by: Cheoleun Moon --- diff --git a/src/tethering.c b/src/tethering.c index 4eab262..017550b 100755 --- a/src/tethering.c +++ b/src/tethering.c @@ -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)