Fix resource leaks 41/200041/1
authorjusung son <jusung07.son@samsung.com>
Mon, 18 Feb 2019 09:27:36 +0000 (18:27 +0900)
committerjusung son <jusung07.son@samsung.com>
Mon, 18 Feb 2019 09:27:36 +0000 (18:27 +0900)
Change-Id: I761c393e39ec2571356686d7863c78f7a15be3e0
Signed-off-by: jusung son <jusung07.son@samsung.com>
backend/sqlite.c

index 7368f98..b1dba16 100644 (file)
@@ -131,6 +131,7 @@ static sqlite3 *open_sqlite3(const char *dbpath, bool readonly)
                                                dbpath, sqlite3_errmsg(db));
                                errno = EIO;
                                free(nm);
+                               sqlite3_close(db);
                                return NULL;
                        }
                }
@@ -142,6 +143,7 @@ static sqlite3 *open_sqlite3(const char *dbpath, bool readonly)
                                        dbpath, sqlite3_errmsg(db));
                        errno = EIO;
                        free(nm);
+                       sqlite3_close(db);
                        return NULL;
                }
        }