fix memory leak 95/76695/1 accepted/tizen/common/20160628.141737 accepted/tizen/ivi/20160629.021111 accepted/tizen/mobile/20160629.021144 accepted/tizen/wearable/20160629.021116 submit/tizen/20160628.102612
authorJongkyu Koo <jk.koo@samsung.com>
Mon, 27 Jun 2016 02:47:40 +0000 (11:47 +0900)
committerJongkyu Koo <jk.koo@samsung.com>
Mon, 27 Jun 2016 02:47:40 +0000 (11:47 +0900)
Change-Id: I10aced63334e8e375c46fa55f4e8a328af6c4e54
Signed-off-by: Jongkyu Koo <jk.koo@samsung.com>
daemon/phnd-dbus.c

index 930e54728a6769d512ab073dba62b02560debfa2..177e67744a6f1209ab99fb60511809f844a750dd 100644 (file)
@@ -132,11 +132,11 @@ static gboolean _dbus_handle_get_location(phnDbus *object,
        ret = _dbus_get_location_handler(number, region, lang, &location);
        if (PHONE_NUMBER_ERROR_NONE != ret) {
                ERR("err ret = %d", ret);
-               location = "";
+               location = strdup("");
        }
 
        phn_dbus_complete_get_location(object, invocation, location, ret);
-
+       free(location);
        phnd_utils_start_timeout();
 
        return TRUE;
@@ -158,11 +158,11 @@ static gboolean _dbus_handle_get_number(phnDbus *object,
 
        if (PHONE_NUMBER_ERROR_NONE != ret) {
                ERR("err ret = %d", ret);
-               formatted_number = "";
+               formatted_number = strdup("");
        }
 
        phn_dbus_complete_get_number(object, invocation, formatted_number, ret);
-
+       free(formatted_number);
        phnd_utils_start_timeout();
 
        return TRUE;
@@ -182,11 +182,11 @@ static gboolean _dbus_handle_get_normalized_number(phnDbus *object,
        ret = _dbus_get_normalized_number_handler(number, &normalized_number);
        if (PHONE_NUMBER_ERROR_NONE != ret) {
                ERR("err ret = %d", ret);
-               normalized_number = "";
+               normalized_number = strdup("");
        }
 
        phn_dbus_complete_get_normalized_number(object, invocation, normalized_number, ret);
-
+       free(normalized_number);
        phnd_utils_start_timeout();
 
        return TRUE;