From 730cd7f0bb10c5d549f58530bfc5e5c56405af50 Mon Sep 17 00:00:00 2001 From: Jaehyun Kim Date: Mon, 4 May 2020 23:59:24 +0900 Subject: [PATCH] ethernet: Fix memory leak Change-Id: Ie45da69063b59bdec02e74e37dc7d38130145803 Signed-off-by: Jaehyun Kim --- plugins/ethernet.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/ethernet.c b/plugins/ethernet.c index 4876f76..57d6542 100644 --- a/plugins/ethernet.c +++ b/plugins/ethernet.c @@ -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); -- 2.7.4