From 97a5f2aed5d13c105dd701d07457bc1b64211f75 Mon Sep 17 00:00:00 2001 From: hj kim Date: Thu, 4 Oct 2018 09:44:30 +0900 Subject: [PATCH] Svace issue fix Change-Id: I505ce1778e8c74be3a7e4d7c45b9a993684f161a --- src/common/media-svc-media.c | 2 +- src/common/media-svc-storage.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/media-svc-media.c b/src/common/media-svc-media.c index ee0e238..9ba27cb 100755 --- a/src/common/media-svc-media.c +++ b/src/common/media-svc-media.c @@ -500,7 +500,7 @@ int _media_svc_delete_invalid_items(sqlite3 *handle, const char *storage_id, med } /*Delete thumbnails*/ - while (thumb_list->len != 0) { + while ((thumb_list != NULL) && (thumb_list->len != 0)) { char *thumb_path = NULL; thumb_path = g_array_index(thumb_list , char*, 0); g_array_remove_index(thumb_list, 0); diff --git a/src/common/media-svc-storage.c b/src/common/media-svc-storage.c index ad4518f..1d97567 100755 --- a/src/common/media-svc-storage.c +++ b/src/common/media-svc-storage.c @@ -164,7 +164,7 @@ int _media_svc_delete_invalid_storage(sqlite3 *handle, media_svc_storage_type_e SQLITE3_FINALIZE(sql_stmt); - while (storage_list->len > 0) { + while ((storage_list != NULL) && (storage_list->len > 0)) { storage_id = g_array_index(storage_list, char *, 0); storage_list = g_array_remove_index(storage_list, 0); @@ -201,7 +201,7 @@ ERROR: SAFE_FREE(storage_id); SAFE_FREE(thumb_path); - while (storage_list->len > 0) { + while ((storage_list != NULL) && (storage_list->len > 0)) { storage_id = g_array_index(storage_list, char *, 0); storage_list = g_array_remove_index(storage_list, 0); SAFE_FREE(storage_id); -- 2.7.4