Fixed coverity issues
[platform/core/connectivity/net-config.git] / src / wifi-config.c
index afa0382..a81285f 100755 (executable)
@@ -151,6 +151,7 @@ static gboolean __get_mac_address(gchar **mac_address)
        }
        mac[12] = '\0';
        *mac_address = g_strdup(mac);
+       g_free(tmp);
 
        return TRUE;
 }
@@ -164,6 +165,7 @@ static gboolean __get_group_name(const gchar *prefix, const gchar *config_id, gc
        ret = __get_mac_address(&mac_address);
        if ((ret != TRUE) || (strlen(mac_address) == 0)) {
                ERR("Cannot get WIFI MAC address");
+               g_free(mac_address);
                return FALSE;
        }
 
@@ -691,6 +693,7 @@ static int __netconfig_unpack_ay_malloc(unsigned char **dst, GVariantIter *iter)
        tmp_dst = (unsigned char *)g_try_malloc0(length + 1);
        if (!tmp_dst) {
                ERR("failed to allocate memory");
+               g_variant_iter_free(iter_copy);
                return 0;
        }