From 612b404c59d0ca1969f28d9dcb7015394a3d507d Mon Sep 17 00:00:00 2001 From: sinikang Date: Wed, 2 Aug 2017 15:22:44 +0900 Subject: [PATCH] Fix memory leakage Change-Id: Ifa0cbe98607f5c5d87547c32fd90004971011a4b --- packaging/tel-plugin-dbus_tapi.spec | 2 +- src/dtapi_sat.c | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/packaging/tel-plugin-dbus_tapi.spec b/packaging/tel-plugin-dbus_tapi.spec index d7baf4a..55dc67b 100644 --- a/packaging/tel-plugin-dbus_tapi.spec +++ b/packaging/tel-plugin-dbus_tapi.spec @@ -1,6 +1,6 @@ %define major 0 %define minor 3 -%define patchlevel 84 +%define patchlevel 85 Name: tel-plugin-dbus_tapi Version: %{major}.%{minor}.%{patchlevel} diff --git a/src/dtapi_sat.c b/src/dtapi_sat.c index b25bf99..699542f 100644 --- a/src/dtapi_sat.c +++ b/src/dtapi_sat.c @@ -396,7 +396,7 @@ gboolean dbus_plugin_sat_response(struct custom_data *ctx, (envelop_rsp->sub_cmd == ENVELOP_RAW_DATA ? "RAW DATA" : "UNKNOWN"))), (envelop_rsp->envelop_resp == ENVELOPE_SUCCESS ? "Success" : - (envelop_rsp->envelop_resp == ENVELOPE_SIM_BUSY? "SIM Busy" : + (envelop_rsp->envelop_resp == ENVELOPE_SIM_BUSY ? "SIM Busy" : "Fail"))); if (envelop_rsp->sub_cmd == ENVELOP_MENU_SELECTION) @@ -1174,7 +1174,7 @@ gboolean dbus_plugin_sat_notification(struct custom_data *ctx, case SAT_PROATV_CMD_SETUP_CALL: { GVariant *setup_call = NULL; gint command_id, call_type, confirmed_text_len, text_len, duration; - gchar *confirmed_text, *text = NULL, *call_number = NULL; + gchar *confirmed_text = NULL, *text = NULL, *call_number = NULL; #if defined(TIZEN_SUPPORT_SAT_ICON) GVariant *icon_id; #endif @@ -1233,14 +1233,15 @@ gboolean dbus_plugin_sat_notification(struct custom_data *ctx, dbg("Failed to de-queue data\n"); } + g_free(confirmed_text); g_free(text); g_free(call_number); return TRUE; } /* In case of No user confirm phase AlphaID in SETUP CALL noti. - * Ref.) ETSI TS 102 223 : Section 6.4.13 and 6.6.12 - */ + * Ref.) ETSI TS 102 223 : Section 6.4.13 and 6.6.12 + */ #if defined(TIZEN_SUPPORT_SAT_ICON) telephony_sat_emit_setup_call(sat, command_id, confirmed_text, confirmed_text_len, @@ -1250,6 +1251,8 @@ gboolean dbus_plugin_sat_notification(struct custom_data *ctx, command_id, confirmed_text, confirmed_text_len, text, text_len, call_type, call_number, duration); #endif + + g_free(confirmed_text); g_free(text); g_free(call_number); } @@ -1385,7 +1388,7 @@ gboolean dbus_plugin_sat_notification(struct custom_data *ctx, gboolean user_confirm = TRUE; int ret; - dbg("Text should be displayed by UI- Open Channel text is displayed!!!"); + dbg("Text should be displayed by UI- Open Channel text is displayed!!!"); #if defined(TIZEN_SUPPORT_SAT_ICON) ui_info = g_variant_new("(isibv)", command_id, @@ -1659,7 +1662,7 @@ gboolean dbus_plugin_sat_notification(struct custom_data *ctx, case SAT_PROATV_CMD_REFRESH: { GVariant *refresh = NULL; gint command_id = 0; - gint refresh_type =0, text_len = 0; + gint refresh_type = 0, text_len = 0; GVariant *file_list = NULL; gchar *text = NULL; int ret; -- 2.7.4