Fixes TC-2116 - Use uninitialized values 36/30836/1
authorJimmy Huang <jimmy.huang@intel.com>
Tue, 25 Nov 2014 19:30:45 +0000 (11:30 -0800)
committerJimmy Huang <jimmy.huang@intel.com>
Tue, 25 Nov 2014 19:34:07 +0000 (11:34 -0800)
Fixes an issue identified by the static code analysis where
pa_strerror is called on a uninitialized value.

Change-Id: I9a2a869c44ba5396f8f3917c47484ae1cb904900
Signed-off-by: Jimmy Huang <jimmy.huang@intel.com>
packaging/lemolo.changes
utils/pulseaudio.c

index 4cc994d..b726b76 100644 (file)
@@ -1,3 +1,6 @@
+* Tue Nov 25 2014 Jimmy Huang <jimmy.huang@intel.com> accepted/tizen/ivi/20141001.212916-2-g7693afc
+- Fixes TC-2116 - Use uninitialized values
+
 * Tue Sep 30 2014 Jimmy Huang <jimmy.huang@intel.com> accepted/tizen/ivi/20140808.112439-1-g6fc6220
 - Fixes TC-1616 - (null) directory generated
 
index f63d09b..98542d2 100644 (file)
@@ -116,18 +116,18 @@ Eina_Bool pa_init(void)
                                 "lemolo");
 
        // connects to the pulse server
-       if (pa_context_connect(pa_ctx,
-                               NULL,
-                               PA_CONTEXT_NOFAIL, NULL) < 0)
+       error = pa_context_connect(pa_ctx, NULL, PA_CONTEXT_NOFAIL, NULL);
+       if (error < 0)
        {
-               ERR("Failed to connect to pulseaudio daemon");
+               ERR("Failed to connect to pulseaudio daemon: %s", pa_strerror(error));
                goto error;
        }
 
        // Creates a connection for ringtone
 #ifdef HAVE_TIZEN
        proplist = pa_proplist_new();
-       if (pa_proplist_sets(proplist, PA_PROP_MEDIA_ROLE, "phone") < 0) {
+       error = pa_proplist_sets(proplist, PA_PROP_MEDIA_ROLE, "phone");
+       if (error < 0) {
                DBG("pa_proplist_sets() failed: %s", pa_strerror(error));
                goto error;
        }