From 0e4684b7b366be4374883d809ebf0b20b62b661e Mon Sep 17 00:00:00 2001 From: Cheoleun Moon Date: Tue, 18 May 2021 18:53:24 +0900 Subject: [PATCH] Check return value of g_unlink Change-Id: I22238a1a5bf606af992a55e1d19868b2fdd3adcf Signed-off-by: Cheoleun Moon --- common/common_eap_connect.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/common/common_eap_connect.c b/common/common_eap_connect.c index f3c1581..2db3193 100644 --- a/common/common_eap_connect.c +++ b/common/common_eap_connect.c @@ -378,15 +378,21 @@ static void _gl_eap_user_cert_sel(void *data, Evas_Object *obj, } if (eap_data->ca_cert_path) { - g_unlink(eap_data->ca_cert_path); + if (g_unlink(eap_data->ca_cert_path) < 0) + INFO_LOG(UG_NAME_ERR, "g_unlink fails. %s", eap_data->ca_cert_path); + g_free(eap_data->ca_cert_path); eap_data->ca_cert_path = NULL; } if (eap_data->user_cert_path) { - g_unlink(eap_data->user_cert_path); + if (g_unlink(eap_data->user_cert_path) < 0) + INFO_LOG(UG_NAME_ERR, "g_unlink fails. %s", eap_data->user_cert_path); + g_free(eap_data->user_cert_path); eap_data->user_cert_path = NULL; } if (eap_data->privatekey_path) { - g_unlink(eap_data->privatekey_path); + if (g_unlink(eap_data->privatekey_path) < 0) + INFO_LOG(UG_NAME_ERR, "g_unlink fails. %s", eap_data->privatekey_path); + g_free(eap_data->privatekey_path); eap_data->privatekey_path = NULL; } -- 2.7.4