ethernet: Fix memory leak 35/232435/1 submit/tizen/20200504.152605
authorJaehyun Kim <jeik01.kim@samsung.com>
Mon, 4 May 2020 14:59:24 +0000 (23:59 +0900)
committerJaehyun Kim <jeik01.kim@samsung.com>
Mon, 4 May 2020 14:59:24 +0000 (23:59 +0900)
Change-Id: Ie45da69063b59bdec02e74e37dc7d38130145803
Signed-off-by: Jaehyun Kim <jeik01.kim@samsung.com>
plugins/ethernet.c

index 4876f76..57d6542 100644 (file)
@@ -221,8 +221,10 @@ static int eth_network_connect(struct connman_network *network)
                g_supplicant_register_eap_callback(handle_eap_signal);
                g_network = network;
 
-               if (asprintf(&config_file, "/opt/usr/data/network/%s-eapol.conf", ifname) < 0)
+               if (asprintf(&config_file, "/opt/usr/data/network/%s-eapol.conf", ifname) < 0) {
+                       g_free(ifname);
                        return -ENOMEM;
+               }
 
                DBG("config_file %s", config_file);