Fix coverity issue (CID 863700)
[platform/core/telephony/tel-plugin-database.git] / src / database_main.c
index 0cf2801..6573d1c 100644 (file)
@@ -53,10 +53,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;