Fix svace defects 25/101325/3 accepted/tizen/3.0/common/20161203.012505 accepted/tizen/3.0/ivi/20161202.011354 accepted/tizen/3.0/mobile/20161202.011257 accepted/tizen/3.0/tv/20161202.011316 accepted/tizen/3.0/wearable/20161202.011335 submit/tizen_3.0/20161201.120416
authorSangchul Lee <sc11.lee@samsung.com>
Thu, 1 Dec 2016 00:46:25 +0000 (09:46 +0900)
committerSeungbae Shin <seungbae.shin@samsung.com>
Thu, 1 Dec 2016 09:53:10 +0000 (18:53 +0900)
[Version] 0.3.80
[Profile] Common
[Issue Type] SVACE

Change-Id: I8dc39d46b8e83346a348c085ebee0ea8732c94dc
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
packaging/capi-media-sound-manager.spec
src/sound_manager_private.c

index f609dc7..cc44a0b 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       capi-media-sound-manager
 Summary:    Sound Manager library
-Version:    0.3.79
+Version:    0.3.80
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index c0d4390..59d2131 100644 (file)
@@ -760,6 +760,12 @@ int _set_manual_route_info(unsigned int index, manual_route_info_s *info)
 
        builder_for_in_devices = g_variant_builder_new(G_VARIANT_TYPE("au"));
        builder_for_out_devices = g_variant_builder_new(G_VARIANT_TYPE("au"));
+       if (!builder_for_in_devices || !builder_for_out_devices) {
+               LOGE("failed to g_variant_builder_new(), builder_for_in_devices(%p), builder_for_out_devices(%p)",
+                       builder_for_in_devices, builder_for_out_devices);
+               ret = MM_ERROR_SOUND_INTERNAL;
+               goto LEAVE;
+       }
        for (i = 0; i < AVAIL_DEVICES_MAX; i++) {
                if (!info->route_in_devices[i])
                        break;
@@ -799,9 +805,11 @@ int _set_manual_route_info(unsigned int index, manual_route_info_s *info)
                info->is_set = true;
 
        g_variant_unref(result);
-       g_variant_builder_unref(builder_for_in_devices);
-       g_variant_builder_unref(builder_for_out_devices);
 LEAVE:
+       if (builder_for_in_devices)
+               g_variant_builder_unref(builder_for_in_devices);
+       if (builder_for_out_devices)
+               g_variant_builder_unref(builder_for_out_devices);
        g_object_unref(conn);
 
        return ret;