[WGID 328329] Fix svace issue #2 09/172109/1 accepted/tizen/unified/20180314.062131 submit/tizen/20180312.020023 submit/tizen/20180313.002626 submit/tizen/20180315.003226
authorJihoon Jung <jh8801.jung@samsung.com>
Mon, 12 Mar 2018 01:55:46 +0000 (10:55 +0900)
committerJihoon Jung <jh8801.jung@samsung.com>
Mon, 12 Mar 2018 01:56:39 +0000 (10:56 +0900)
Signed-off-by: Jihoon Jung <jh8801.jung@samsung.com>
Change-Id: Ib4fe5a94f2025304bcf493058e4b7f8b4e88357a

src/manager/net_nfc_server_route_table.c

index 0deea049791e204780265749731229db4fdc69bb..aaed90bfbad39c3726bb1071156bebde33e20fa4 100755 (executable)
@@ -117,8 +117,8 @@ static void __create_table()
 
 static int __check_integrity()
 {
-       int result = 0;
        sqlite3_stmt *stmt = NULL;
+       int result = 0;
 
        if (db == 0) {
                DEBUG_ERR_MSG("failed to check handle");
@@ -140,11 +140,13 @@ static int __check_integrity()
                                DEBUG_ERR_MSG("failed to check integrity");
                                result = -1;
                        }
+               } else {
+                       result = 0;
                }
-
-               sqlite3_finalize(stmt);
        }
 
+       sqlite3_finalize(stmt);
+
        return result;
 }