Fix coverity issues 20/186220/3 accepted/tizen/unified/20180809.074745 submit/tizen/20180808.083139
authorSangchul Lee <sc11.lee@samsung.com>
Wed, 8 Aug 2018 06:41:04 +0000 (15:41 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Wed, 8 Aug 2018 06:56:38 +0000 (15:56 +0900)
[Version] 0.12.26
[Issue Type] Coverity

Change-Id: Ibea05053ed04c21c347471d9e885206ca944afc9
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
focus_server/mm_sound_mgr_focus_socket.c
mm_sound_focus_socket.c
packaging/libmm-sound.spec

index ae5f6b7d766b9f4b400fafad6773a30f8d412f7f..dabe22c321aeb3970c2d8131a14d0d42f2171a8f 100644 (file)
@@ -400,7 +400,8 @@ static void* ready_thread_func(void *data)
 LEAVE:
        debug_fleave();
        pthread_attr_destroy(&attr);
-       close(fd);
+       if (fd != -1)
+               close(fd);
        pthread_exit(NULL);
 }
 
index 1e7c0db3d920eedb7f775cb0fb4c823530b8fef5..152e2036a476477bb7a840dcf8cc5542bbe4f319 100644 (file)
@@ -193,7 +193,7 @@ int mm_sound_focus_socket_register(int pid, const char *stream_type, int *client
        memset(&data, 0x00, sizeof(_mm_sound_focus_socket_param_t));
        memset(&result, 0x00, sizeof(_mm_sound_focus_socket_result_t));
        FILL_SOCKET_PARAM_REGISTER(data, FOCUS_FUNC_NAME_REGISTER, pid, stream_type);
-       if ((ret = _send_data_to_server(*client_fd, &data, &result)) < 0) {
+       if ((ret = _send_data_to_server(*client_fd, &data, &result))) {
                debug_error("failed to _send_data_to_server(), ret[0x%x]", ret);
                close(*client_fd);
                return ret;
@@ -257,7 +257,7 @@ int mm_sound_focus_socket_add_watch_cb(int pid, mm_sound_focus_type_e focus_type
        memset(&data, 0x00, sizeof(_mm_sound_focus_socket_param_t));
        memset(&result, 0x00, sizeof(_mm_sound_focus_socket_result_t));
        FILL_SOCKET_PARAM_ADD_WATCH(data, FOCUS_FUNC_NAME_ADD_WATCH, pid, focus_type);
-       if ((ret = _send_data_to_server(*client_fd, &data, &result)) < 0) {
+       if ((ret = _send_data_to_server(*client_fd, &data, &result))) {
                debug_error("failed to _send_data_to_server(), ret[0x%x]", ret);
                close(*client_fd);
                return ret;
index 00d815b3172da5dba17f6fd666114d57a7e441da..a2e22737ba11bc7518f448a83cf58eaa10ab3211 100644 (file)
@@ -1,6 +1,6 @@
 Name:       libmm-sound
 Summary:    MMSound Package contains client lib and sound_server binary
-Version:    0.12.25
+Version:    0.12.26
 Release:    0
 Group:      System/Libraries
 License:    Apache-2.0