From: Jongkyu Koo Date: Mon, 27 Jun 2016 02:47:40 +0000 (+0900) Subject: fix memory leak X-Git-Tag: submit/tizen/20160628.102612^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=17f73888e4431513ccbc14004cc2c8da7c8111c5;p=platform%2Fcore%2Ftelephony%2Fphonenumber-utils.git fix memory leak Change-Id: I10aced63334e8e375c46fa55f4e8a328af6c4e54 Signed-off-by: Jongkyu Koo --- diff --git a/daemon/phnd-dbus.c b/daemon/phnd-dbus.c index 930e547..177e677 100644 --- a/daemon/phnd-dbus.c +++ b/daemon/phnd-dbus.c @@ -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;