Fix coverity issue (CID 863700) 26/183626/1 accepted/tizen_4.0_unified tizen_4.0 accepted/tizen/4.0/unified/20180710.164236 submit/tizen_4.0/20180709.065759
authorsinikang <sinikang@samsung.com>
Mon, 9 Jul 2018 05:59:28 +0000 (14:59 +0900)
committersinikang <sinikang@samsung.com>
Mon, 9 Jul 2018 05:59:28 +0000 (14:59 +0900)
Change-Id: If3c242bc463ffee5b38b8ce600e971c8194af55a

packaging/tel-plugin-database.spec
src/database_main.c

index c4c8d0c..1c4ed62 100644 (file)
@@ -1,6 +1,6 @@
 %define major 0
 %define minor 1
-%define patchlevel 38
+%define patchlevel 39
 
 Name:           tel-plugin-database
 Version:        %{major}.%{minor}.%{patchlevel}
index a96c5ae..934b430 100644 (file)
@@ -52,10 +52,17 @@ static void *create_handle(Storage *strg, const char *path)
 
 static gboolean remove_handle(Storage *strg, void *handle)
 {
+       int rv = 0;
+
        if (!handle)
                return FALSE;
 
-       db_util_close(handle);
+       rv = db_util_close(handle);
+       if (rv != SQLITE_OK) {
+               err("fail to close database err(%d)", rv);
+               handle = NULL;
+               return FALSE;
+       }
 
        dbg("disconnected from database");
        return TRUE;