Fix memory leak (sound-server) : valgrind
[platform/core/multimedia/libmm-sound.git] / server / mm_sound_mgr_ipc_dbus.c
index 1fc3ec1..b580b28 100644 (file)
@@ -298,7 +298,7 @@ send_reply:
 static void handle_method_play_file_start(GDBusMethodInvocation* invocation)
 {
        gchar* filename = NULL;
-       char *stream_type = NULL;
+       gchar *stream_type = NULL;
        gint32 ret = MM_ERROR_NONE, slotid = 0;
        gint32 tone = 0, repeat = 0, volume = 0, vol_config = 0, priority = 0;
        gint32 session_type = 0, session_option = 0, pid = 0, handle_route =0, stream_index = 0;
@@ -323,6 +323,7 @@ static void handle_method_play_file_start(GDBusMethodInvocation* invocation)
        ret = _MMSoundMgrIpcPlayFile(filename, tone, repeat, volume, vol_config, priority,
                                session_type, session_option, _get_sender_pid(invocation), handle_route, enable_session, &slotid, stream_type, stream_index);
 
+
 send_reply:
        if (ret == MM_ERROR_NONE) {
                _method_call_return_value(invocation, g_variant_new("(i)", slotid));
@@ -330,13 +331,16 @@ send_reply:
                _method_call_return_error(invocation, ret);
        }
 
+       g_free(filename);
+       g_free(stream_type);
+
        debug_fleave();
 }
 
 static void handle_method_play_file_start_with_stream_info(GDBusMethodInvocation* invocation)
 {
        gchar* filename = NULL;
-       char *stream_type = NULL;
+       gchar *stream_type = NULL;
        gint32 ret = MM_ERROR_NONE, slotid = 0;
        gint32 repeat = 0, volume = 0, priority = 0, pid = 0, handle_route =0, stream_index = 0;
        GVariant *params = NULL;
@@ -366,6 +370,9 @@ send_reply:
                _method_call_return_error(invocation, ret);
        }
 
+       g_free(filename);
+       g_free(stream_type);
+
        debug_fleave();
 }
 
@@ -373,7 +380,7 @@ static void handle_method_play_dtmf(GDBusMethodInvocation* invocation)
 {
        int ret = MM_ERROR_NONE, slotid = 0;
        int tone = 0, repeat = 0, volume = 0, vol_config = 0, session_type = 0, session_option = 0, pid = 0, stream_index = 0;
-       char* stream_type = NULL;
+       gchar* stream_type = NULL;
        gboolean enable_session = 0;
        GVariant *params = NULL;
 
@@ -398,6 +405,7 @@ send_reply:
                _method_call_return_error(invocation, ret);
        }
 
+       g_free(stream_type);
 
        debug_fleave();
 }