From 4cfcdd661d398691163f27c0ad9744b33d2dfae9 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Wed, 16 Sep 2009 12:41:44 +0300 Subject: [PATCH] Minor cleanup to newRpmdb() - no need to free what hasn't been allocated yet --- lib/rpmdb.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/lib/rpmdb.c b/lib/rpmdb.c index c405fa5..890b674 100644 --- a/lib/rpmdb.c +++ b/lib/rpmdb.c @@ -907,19 +907,14 @@ rpmdb newRpmdb(const char * root, if (perms >= 0) db->db_perms = perms; if (flags >= 0) db->db_flags = flags; - if (root && *root) { - db->db_root = rpmGetPath(root, NULL); - } else - db->db_root = rpmGetPath(_DB_ROOT, NULL); - db->db_home = rpmGetPath( (home && *home ? home : _DB_HOME), NULL); if (!(db->db_home && db->db_home[0] != '%')) { rpmlog(RPMLOG_ERR, _("no dbpath has been set\n")); - db->db_root = _free(db->db_root); db->db_home = _free(db->db_home); db = _free(db); return NULL; } + db->db_root = rpmGetPath((root && *root) ? root : _DB_ROOT, NULL); db->db_errpfx = rpmExpand( (epfx && *epfx ? epfx : _DB_ERRPFX), NULL); db->db_remove_env = 0; db->db_filter_dups = _db_filter_dups; -- 2.7.4