Fix coverity defects 05/177005/1 accepted/tizen/unified/20180426.062531 submit/tizen/20180425.084522
authorSeungbae Shin <seungbae.shin@samsung.com>
Tue, 24 Apr 2018 11:36:26 +0000 (20:36 +0900)
committerSeungbae Shin <seungbae.shin@samsung.com>
Tue, 24 Apr 2018 11:36:26 +0000 (20:36 +0900)
fix minor build warning

[Version] 0.12.14
[Issue Type] Security

Change-Id: I5eee1290de2fb381f61078e099e566ae166e530e

packaging/libmm-sound.spec
server/plugin/wav/mm_sound_plugin_codec_wave.c
testsuite/mm_sound_testsuite_simple.c

index 8b15c1c..0ba131b 100644 (file)
@@ -1,6 +1,6 @@
 Name:       libmm-sound
 Summary:    MMSound Package contains client lib and sound_server binary
-Version:    0.12.13
+Version:    0.12.14
 Release:    0
 Group:      System/Libraries
 License:    Apache-2.0
index 438f6e6..e97f89a 100644 (file)
@@ -318,13 +318,13 @@ static int _pa_context_connect(wave_info_t *h)
        /* Mainloop */
        if (!(m = pa_threaded_mainloop_new())) {
                debug_error("mainloop create failed");
-               goto error;
+               return -1;
        }
 
        /* Context */
        if (!(c = pa_context_new(pa_threaded_mainloop_get_api(m), NULL))) {
                debug_error("context create failed");
-               goto error;
+               goto error_context_new;
        }
 
        pa_context_set_state_callback(c, _pa_context_state_callback, m);
@@ -362,13 +362,10 @@ static int _pa_context_connect(wave_info_t *h)
        return 0;
 
 error:
-       if (c)
-               pa_context_unref(c);
-
+       pa_context_unref(c);
        pa_threaded_mainloop_unlock(m);
-
-       if (m)
-               pa_threaded_mainloop_free(m);
+error_context_new:
+       pa_threaded_mainloop_free(m);
 
        return -1;
 }
index fc519dc..765503a 100755 (executable)
@@ -861,7 +861,7 @@ static void interpret(char *cmd)
 
                                        ret = readdir_r(basedir, prev_entry, &entry);
                                        if (ret == 0) {
-                                               debug_error("error on readdir_r(%s)", basedir);
+                                               debug_error("error on readdir_r(%p)", basedir);
                                                break;
                                        }
                                        if (entry == NULL)