From: Panu Matilainen Date: Tue, 18 Dec 2007 07:27:42 +0000 (+0200) Subject: Use constfree for rpmdb_s contents for now X-Git-Tag: tznext/4.11.0.1.tizen20130304~4768 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fbd12ed8018a146ca339f684348302d1f85c277d;p=tools%2Flibrpm-tizen.git Use constfree for rpmdb_s contents for now - rpmdb_internal is included from several places over the tree --- diff --git a/rpmdb/dbconfig.c b/rpmdb/dbconfig.c index beb31ba..edcad48 100644 --- a/rpmdb/dbconfig.c +++ b/rpmdb/dbconfig.c @@ -244,14 +244,14 @@ struct poptOption rdbOptions[] = { dbiIndex db3Free(dbiIndex dbi) { if (dbi) { - dbi->dbi_root = _free(dbi->dbi_root); - dbi->dbi_home = _free(dbi->dbi_home); - dbi->dbi_file = _free(dbi->dbi_file); - dbi->dbi_subfile = _free(dbi->dbi_subfile); - dbi->dbi_tmpdir = _free(dbi->dbi_tmpdir); + dbi->dbi_root = _constfree(dbi->dbi_root); + dbi->dbi_home = _constfree(dbi->dbi_home); + dbi->dbi_file = _constfree(dbi->dbi_file); + dbi->dbi_subfile = _constfree(dbi->dbi_subfile); + dbi->dbi_tmpdir = _constfree(dbi->dbi_tmpdir); dbi->dbi_host = _free(dbi->dbi_host); - dbi->dbi_errpfx = _free(dbi->dbi_errpfx); - dbi->dbi_re_source = _free(dbi->dbi_re_source); + dbi->dbi_errpfx = _constfree(dbi->dbi_errpfx); + dbi->dbi_re_source = _constfree(dbi->dbi_re_source); dbi->dbi_stats = _free(dbi->dbi_stats); dbi = _free(dbi); } diff --git a/rpmdb/rpmdb.c b/rpmdb/rpmdb.c index 87f8334..0032eb3 100644 --- a/rpmdb/rpmdb.c +++ b/rpmdb/rpmdb.c @@ -815,9 +815,9 @@ int rpmdbClose(rpmdb db) if (xx && rc == 0) rc = xx; db->_dbi[dbix] = NULL; } - db->db_errpfx = _free(db->db_errpfx); - db->db_root = _free(db->db_root); - db->db_home = _free(db->db_home); + db->db_errpfx = _constfree(db->db_errpfx); + db->db_root = _constfree(db->db_root); + db->db_home = _constfree(db->db_home); db->db_bits = PBM_FREE(db->db_bits); db->_dbi = _free(db->_dbi); @@ -906,8 +906,8 @@ rpmdb newRpmdb(const char * root, 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->db_root = _constfree(db->db_root); + db->db_home = _constfree(db->db_home); db = _free(db); return NULL; } diff --git a/rpmdb/sqlite.c b/rpmdb/sqlite.c index f7cf853..ac2989e 100644 --- a/rpmdb/sqlite.c +++ b/rpmdb/sqlite.c @@ -748,7 +748,7 @@ enterChroot(dbi); dbi->dbi_subfile); dbi->dbi_stats = _free(dbi->dbi_stats); - dbi->dbi_file = _free(dbi->dbi_file); + dbi->dbi_file = _constfree(dbi->dbi_file); dbi->dbi_db = _free(dbi->dbi_db); leaveChroot(dbi);