Fix the Svace issue 167371 ~ 167378 33/125533/1 accepted/tizen/unified/20170418.072917 submit/tizen/20170418.044051
authorHyeKyoung Hwang <cookie@samsung.com>
Tue, 18 Apr 2017 02:21:59 +0000 (11:21 +0900)
committerHyeKyoung Hwang <cookie@samsung.com>
Tue, 18 Apr 2017 02:21:59 +0000 (11:21 +0900)
Change-Id: I0864f1d5bf0a7f6559c5df6547ab5923180761b4
Signed-off-by: HyeKyoung Hwang <cookie@samsung.com>
provider/browser-provider-bookmarks.c
provider/browser-provider-requests.c

index 4f6b5e741176a24fc1e440a7630bb43b8479cb0b..bd11b48a6da40e0568204bd19a1c2a9032255999 100755 (executable)
@@ -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;
index 80791979c1936642393c039db41c5316e7c9df0e..e1668a45421517f2471e65cad55922f2a00ef2d0 100755 (executable)
@@ -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;