[WGID 328329] Fix svace issue 00/172100/1
authorJihoon Jung <jh8801.jung@samsung.com>
Mon, 12 Mar 2018 01:17:52 +0000 (10:17 +0900)
committerJihoon Jung <jh8801.jung@samsung.com>
Mon, 12 Mar 2018 01:19:06 +0000 (10:19 +0900)
Signed-off-by: Jihoon Jung <jh8801.jung@samsung.com>
Change-Id: Ic6214b86a824e5270110b537bd6012e674924793

src/manager/net_nfc_server_route_table.c

index e22f7ccb68f83f39acd5b53523e64d73a7f82277..0deea049791e204780265749731229db4fdc69bb 100755 (executable)
@@ -117,6 +117,7 @@ static void __create_table()
 
 static int __check_integrity()
 {
+       int result = 0;
        sqlite3_stmt *stmt = NULL;
 
        if (db == 0) {
@@ -134,16 +135,17 @@ static int __check_integrity()
                        const char *ret_val = (const char *)sqlite3_column_text(stmt, 0);
                        DEBUG_ERR_MSG("ret_val: %s", ret_val);
                        if (ret_val && strcmp(ret_val, "ok") == 0) {
-                               return 0;
+                               result = 0;
                        } else {
                                DEBUG_ERR_MSG("failed to check integrity");
-                               return -1;
+                               result = -1;
                        }
-               } else {
-                       return 0;
                }
+
+               sqlite3_finalize(stmt);
        }
-       return 0;
+
+       return result;
 }
 
 static void __prepare_table()