fix svace issue 72/63472/1 accepted/tizen/ivi/20160330.042322 accepted/tizen/mobile/20160325.032014 submit/tizen/20160324.072405 submit/tizen_common/20160324.165600
authorjongmun.woo <jongmun.woo@samsung.com>
Thu, 24 Mar 2016 07:18:08 +0000 (16:18 +0900)
committerjongmun.woo <jongmun.woo@samsung.com>
Thu, 24 Mar 2016 07:18:23 +0000 (16:18 +0900)
Signed-off-by: jongmun.woo <jongmun.woo@samsung.com>
Change-Id: I92011c7839df56b074847f1e4834f4af25e841cf

module/module_geofence_server.c

index 2944c3a..0011ec9 100644 (file)
@@ -257,9 +257,6 @@ EXPORT_API int get_geofences(void *handle, int place_id, int *fence_amount, int
        int *fence_id_array = (int *) g_slice_alloc0(sizeof(int) * fence_cnt);
        geofence_s *p = (geofence_s *) g_slice_alloc0(sizeof(geofence_s) * fence_cnt);
 
-       if (iter == NULL) {
-               MOD_LOGI("Iterator is null");
-       }
        while (g_variant_iter_next(iter, "a{sv}", &iter_row)) {
                while (g_variant_iter_loop(iter_row, "{sv}", &key, &value)) {
                        if (!g_strcmp0(key, "fence_id")) {
@@ -287,7 +284,8 @@ EXPORT_API int get_geofences(void *handle, int place_id, int *fence_amount, int
                index++;
                g_variant_iter_free(iter_row);
        }
-       g_variant_iter_free(iter);
+       if (iter != NULL)
+               g_variant_iter_free(iter);
        *params = (geofence_s *) p;
        *fence_ids = fence_id_array;