Fix for coverity defects 96/176796/1 accepted/tizen/unified/20180424.165708 submit/tizen/20180424.040057
authorSeungbae Shin <seungbae.shin@samsung.com>
Mon, 23 Apr 2018 11:38:59 +0000 (20:38 +0900)
committerSeungbae Shin <seungbae.shin@samsung.com>
Mon, 23 Apr 2018 11:38:59 +0000 (20:38 +0900)
[Version] 11.1.5
[Issue Type] Security

Change-Id: I8b22ee1451f91e294e59e07d33ac53cb7208a27e

packaging/pulseaudio-modules-tizen.spec
src/stream-manager.c

index 1c9e0c1599055061c12a9fce7d52c7c467988b48..0dd3f850d4357b63cb623b49d73bb09ea9ba3ad1 100644 (file)
@@ -1,6 +1,6 @@
 Name:             pulseaudio-modules-tizen
 Summary:          Pulseaudio modules for Tizen
-Version:          11.1.4
+Version:          11.1.5
 Release:          0
 Group:            Multimedia/Audio
 License:          LGPL-2.1+
index 0e8e88551ad0c2d82e459cc65458b1d83cbcef57..d835372fc911e35344cc72700afef34786db9526 100644 (file)
@@ -612,6 +612,23 @@ static void stream_info_free(stream_info *s) {
     pa_xfree(s);
 }
 
+static void deinit_stream_map(pa_stream_manager *m) {
+    pa_assert(m);
+
+    if (m->stream_infos) {
+        pa_hashmap_free(m->stream_infos);
+        m->stream_infos = NULL;
+    }
+    if (m->volume_infos) {
+        pa_hashmap_free(m->volume_infos);
+        m->volume_infos = NULL;
+    }
+    if (m->latency_infos) {
+        pa_hashmap_free(m->latency_infos);
+        m->latency_infos = NULL;
+    }
+}
+
 static int init_stream_map(pa_stream_manager *m) {
     volume_info *v = NULL;
     stream_info *s = NULL;
@@ -837,27 +854,11 @@ fail:
     pa_xfree(s);
     pa_xfree(l);
 
-    if (m->stream_infos)
-        pa_hashmap_free(m->stream_infos);
-    if (m->volume_infos)
-        pa_hashmap_free(m->volume_infos);
-    if (m->latency_infos)
-        pa_hashmap_free(m->latency_infos);
+    deinit_stream_map(m);
 
     return -1;
 }
 
-static void deinit_stream_map(pa_stream_manager *m) {
-    pa_assert(m);
-
-    if (m->stream_infos)
-        pa_hashmap_free(m->stream_infos);
-    if (m->volume_infos)
-        pa_hashmap_free(m->volume_infos);
-    if (m->latency_infos)
-        pa_hashmap_free(m->latency_infos);
-}
-
 static bool check_name_to_skip(pa_stream_manager *m, process_command_type_t command, void *stream, stream_type_t type, bool is_new_data) {
     bool ret = false;
     const char *name = NULL;