From fe7c5d041daa636cf4cd8166d916f7c9d1b8fab5 Mon Sep 17 00:00:00 2001 From: jongmyeongko Date: Mon, 6 Mar 2017 14:05:26 +0900 Subject: [PATCH] Fix error handle bug When there was an error in previous iteration, error->messge wil be referenced as an freed state in next iteration. This may causes a crash. Change-Id: Iedf6414ea359a1decc06007a919650469768c705 Signed-off-by: jongmyeongko --- plugin/app2sd/lib/app2sd_client_interface.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugin/app2sd/lib/app2sd_client_interface.c b/plugin/app2sd/lib/app2sd_client_interface.c index 2f8437d..86e689e 100644 --- a/plugin/app2sd/lib/app2sd_client_interface.c +++ b/plugin/app2sd/lib/app2sd_client_interface.c @@ -85,6 +85,7 @@ static int __app2sd_call_server_method(const gchar *method_name, _E("failed to create new proxy, error(%s)", error->message); g_error_free(error); + error = NULL; ret = APP2EXT_ERROR_DBUS_FAILED; retry_cnt++; usleep(CONNECTION_WAIT_USEC); @@ -97,6 +98,7 @@ static int __app2sd_call_server_method(const gchar *method_name, if (error != NULL) { _E("proxy call sync error(%s)", error->message); g_error_free(error); + error = NULL; ret = APP2EXT_ERROR_DBUS_FAILED; retry_cnt++; usleep(CONNECTION_WAIT_USEC); -- 2.7.4