fix WGID 110834 76/172776/1 accepted/tizen/4.0/unified/20180316.062554 submit/tizen_4.0/20180316.012949
authorsaerome.kim <saerome.kim@samsung.com>
Thu, 15 Mar 2018 05:19:11 +0000 (14:19 +0900)
committersaerome kim <saerome.kim@samsung.com>
Fri, 16 Mar 2018 01:26:56 +0000 (01:26 +0000)
- Resource leak problem

Change-Id: Ie2985204bc1d44261040d1074521f7eaf0718f90
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
src/entity/mtp_store.c

index 7105fa3..882fac5 100755 (executable)
@@ -472,8 +472,13 @@ mtp_uint32 _entity_get_objects_from_store_till_depth(mtp_store_t *store,
                mtp_uint32 ii = 0;
 
                child_arr = _prop_alloc_ptparray(UINT32_TYPE);
-               if (child_arr == NULL || child_arr->array_entry == NULL)
+               if (child_arr == NULL) {
                        return 0;
+               }
+               if (child_arr->array_entry == NULL) {
+                       _prop_destroy_ptparray(child_arr);
+                       return 0;
+               }
 
                depth--;