]> git.ipfire.org Git - pakfire.git/commitdiff
transaction: Always initialize the database pointer
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 29 Jun 2025 16:39:03 +0000 (16:39 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 29 Jun 2025 16:39:03 +0000 (16:39 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/pakfire/transaction.c

index 25538339089bd7dac211fecad90f9e23d463e023..f5ad108d1ae2ae817d21e44051ca11d8d5b9b097 100644 (file)
@@ -1863,7 +1863,7 @@ static int pakfire_usrmove(pakfire_ctx* ctx, pakfire_root* root) {
 static int pakfire_transaction_perform(pakfire_transaction* self) {
        pakfire_repo* repo = NULL;
        pakfire_jail* jail = NULL;
-       pakfire_db* db;
+       pakfire_db* db = NULL;
        size_t total_size = 0;
        int r;
 
@@ -1941,7 +1941,8 @@ ERROR:
                pakfire_jail_unref(jail);
        if (repo)
                pakfire_repo_unref(repo);
-       pakfire_db_unref(db);
+       if (db)
+               pakfire_db_unref(db);
 
        return r;
 }