Fix error handle bug 35/117435/1 accepted/tizen/3.0/common/20170307.113344 accepted/tizen/3.0/ivi/20170307.090622 accepted/tizen/3.0/mobile/20170307.090232 accepted/tizen/3.0/tv/20170307.090448 accepted/tizen/3.0/wearable/20170307.090533 submit/tizen_3.0/20170306.070943 submit/tizen_3.0/20170307.014135
authorjongmyeongko <jongmyeong.ko@samsung.com>
Mon, 6 Mar 2017 05:05:26 +0000 (14:05 +0900)
committerjongmyeong ko <jongmyeong.ko@samsung.com>
Mon, 6 Mar 2017 06:04:17 +0000 (22:04 -0800)
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 <jongmyeong.ko@samsung.com>
plugin/app2sd/lib/app2sd_client_interface.c

index 2f8437d..86e689e 100644 (file)
@@ -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);