From: HyeKyoung Hwang Date: Tue, 18 Apr 2017 02:21:59 +0000 (+0900) Subject: Fix the Svace issue 167371 ~ 167378 X-Git-Tag: submit/tizen/20170418.044051^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2ad97eb42d175121bc46f1da107c39b57bb5de0f;p=platform%2Fframework%2Fweb%2Fbrowser-provider.git Fix the Svace issue 167371 ~ 167378 Change-Id: I0864f1d5bf0a7f6559c5df6547ab5923180761b4 Signed-off-by: HyeKyoung Hwang --- diff --git a/provider/browser-provider-bookmarks.c b/provider/browser-provider-bookmarks.c index 4f6b5e7..bd11b48 100755 --- a/provider/browser-provider-bookmarks.c +++ b/provider/browser-provider-bookmarks.c @@ -648,7 +648,8 @@ static bp_error_defs __bp_bookmark_get_ids(int sock) bp_ipc_send_custom_type(sock, &ids_count, sizeof(int)); bp_ipc_send_custom_type(sock, ids, (sizeof(int) * ids_count)); } - free(ids); + if (ids != NULL) + free(ids); if (conditions != NULL) sqlite3_free(conditions); return errorcode; @@ -674,7 +675,8 @@ static bp_error_defs __bp_sync_bookmark_get_full_with_deleted_ids(int sock) bp_ipc_send_custom_type(sock, &ids_count, sizeof(int)); bp_ipc_send_custom_type(sock, ids, (sizeof(int) * ids_count)); } - free(ids); + if (ids != NULL) + free(ids); if (conditions != NULL) sqlite3_free(conditions); return errorcode; @@ -735,7 +737,8 @@ static bp_error_defs __bp_sync_bookmark_get_dirty_ids(int sock) bp_ipc_send_custom_type(sock, &ids_count, sizeof(int)); bp_ipc_send_custom_type(sock, ids, (sizeof(int) * ids_count)); } - free(ids); + if (ids != NULL) + free(ids); if (conditions != NULL) sqlite3_free(conditions); return errorcode; @@ -763,7 +766,8 @@ static bp_error_defs __bp_sync_bookmark_get_deleted_ids(int sock) bp_ipc_send_custom_type(sock, &ids_count, sizeof(int)); bp_ipc_send_custom_type(sock, ids, (sizeof(int) * ids_count)); } - free(ids); + if (ids != NULL) + free(ids); if (conditions != NULL) sqlite3_free(conditions); return errorcode; diff --git a/provider/browser-provider-requests.c b/provider/browser-provider-requests.c index 8079197..e1668a4 100755 --- a/provider/browser-provider-requests.c +++ b/provider/browser-provider-requests.c @@ -285,7 +285,8 @@ bp_error_defs bp_common_get_full_ids(sqlite3 *handle, bp_ipc_send_custom_type(sock, &ids_count, sizeof(int)); bp_ipc_send_custom_type(sock, ids, (sizeof(int) * ids_count)); } - free(ids); + if (ids != NULL) + free(ids); if (conditions != NULL) sqlite3_free(conditions); return errorcode; @@ -310,7 +311,8 @@ bp_error_defs bp_common_get_full_with_deleted_ids bp_ipc_send_custom_type(sock, &ids_count, sizeof(int)); bp_ipc_send_custom_type(sock, ids, (sizeof(int) * ids_count)); } - free(ids); + if (ids != NULL) + free(ids); return errorcode; } @@ -335,7 +337,8 @@ bp_error_defs bp_common_get_dirty_ids(sqlite3 *handle, bp_ipc_send_custom_type(sock, &ids_count, sizeof(int)); bp_ipc_send_custom_type(sock, ids, (sizeof(int) * ids_count)); } - free(ids); + if (ids != NULL) + free(ids); if (conditions != NULL) sqlite3_free(conditions); return errorcode; @@ -363,7 +366,8 @@ bp_error_defs bp_common_get_deleted_ids bp_ipc_send_custom_type(sock, &ids_count, sizeof(int)); bp_ipc_send_custom_type(sock, ids, (sizeof(int) * ids_count)); } - free(ids); + if (ids != NULL) + free(ids); if (conditions != NULL) sqlite3_free(conditions); return errorcode;