Fix svace issues 94/101394/1
authorJeongho Mok <jho.mok@samsung.com>
Wed, 30 Nov 2016 09:08:16 +0000 (18:08 +0900)
committerJeongho Mok <jho.mok@samsung.com>
Thu, 1 Dec 2016 05:38:15 +0000 (21:38 -0800)
[Version] 5.0.96
[Profile] Common
[Issue Type] svace

Change-Id: I775b604292d9de2ef9427acc14c929e79d96df39
(cherry picked from commit d50db18d601e5bc0469715f5787b0b3950d78b23)

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

index 3d316a6..5afe532 100644 (file)
@@ -1,6 +1,6 @@
 Name:             pulseaudio-modules-tizen
 Summary:          Pulseaudio modules for Tizen
-Version:          5.0.95
+Version:          5.0.96
 Release:          0
 Group:            Multimedia/Audio
 License:          LGPL-2.1+
index a386729..319d098 100644 (file)
@@ -694,11 +694,6 @@ static int pulse_device_get_alsa_device_string(pa_proplist *prop, char **device_
         return -1;
     }
 
-    if (((device_string_tmp + 1) == '\0')) {
-        pa_log_error("no device string value");
-        return -1;
-    }
-
     *device_string = device_string_tmp + 1;
 
     return 0;
index 69f309f..432dd97 100644 (file)
@@ -67,11 +67,11 @@ bool check_restrictions(pa_stream_manager *m, void *stream, stream_type_t type)
     /* check for media recording */
     if (m->restrictions.block_recording_media && type == STREAM_SOURCE_OUTPUT) {
         role = pa_proplist_gets(GET_STREAM_NEW_PROPLIST(stream, type), PA_PROP_MEDIA_ROLE);
-        if (pa_streq(role, "media")) {
+        if (pa_safe_streq(role, "media")) {
             pa_log_warn("recording(media) is not allowed");
             return true;
         }
     }
 
     return false;
-}
\ No newline at end of file
+}
index 051a287..dc74cf9 100644 (file)
@@ -121,15 +121,12 @@ static int load_out_volume_conf_file(pa_stream_manager *m) {
             } else {
                 pa_log_warn("[%s] is not defined, skip it", key);
             }
+            free(key);
         } else {
             pa_log_error("failed to pa_xmalloc0()");
             ret = -1;
             goto finish;
         }
-        if (key) {
-            free(key);
-            key = NULL;
-        }
     }
 
     /* Load gain table */
@@ -149,20 +146,15 @@ static int load_out_volume_conf_file(pa_stream_manager *m) {
             } else {
                 pa_log_warn("[%s] is not defined, skip it", key);
             }
+            free(key);
         } else {
             pa_log_error("failed to pa_xmalloc0()");
             ret = -1;
             goto finish;
         }
-        if (key) {
-            free(key);
-            key = NULL;
-        }
     }
 
 finish:
-    if (key)
-        free(key);
     if (dict)
         iniparser_freedict(dict);