Use constfree for rpmdb_s contents for now
authorPanu Matilainen <pmatilai@redhat.com>
Tue, 18 Dec 2007 07:27:42 +0000 (09:27 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Tue, 18 Dec 2007 07:27:42 +0000 (09:27 +0200)
- rpmdb_internal is included from several places over the tree

rpmdb/dbconfig.c
rpmdb/rpmdb.c
rpmdb/sqlite.c

index beb31ba..edcad48 100644 (file)
@@ -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);
     }
index 87f8334..0032eb3 100644 (file)
@@ -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;
     }
index f7cf853..ac2989e 100644 (file)
@@ -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);