Radish alpha
H
HardenedBSD Package Manager
Radicle
Git (anonymous pull)
Log in to clone via SSH
Fix struct pkgdb leak if unable to create db directory in pkgdb_open()
Bryan Drewery committed 12 years ago
commit e1b6301215b778a562acb36ed38f7ebdeb519d97
parent 7f5c4858da5aca2995cf3c644a88ccc4dabb0e93
1 file changed +4 -2
modified libpkg/pkgdb.c
@@ -975,9 +975,11 @@ pkgdb_open(struct pkgdb **db_p, pkgdb_t type)
			}
		}

-
		/* Create the diretory if it doesn't exists */
-
		if (createdir && mkdirs(dbdir) != EPKG_OK)
+
		/* Create the directory if it doesn't exist */
+
		if (createdir && mkdirs(dbdir) != EPKG_OK) {
+
			pkgdb_close(db);
			return (EPKG_FATAL);
+
		}

		sqlite3_initialize();