Return explicit NULL from dbiFreeIndexSet()
authorPanu Matilainen <pmatilai@redhat.com>
Mon, 6 Jun 2011 10:10:32 +0000 (13:10 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Mon, 6 Jun 2011 10:10:32 +0000 (13:10 +0300)
- Explicit NULL is much more obvious here, also eliminate the (now)
  dead NULL-assignments and add a trash-n-burn memset() just in case

lib/rpmdb.c

index 7bb7068..c124fb1 100644 (file)
@@ -438,10 +438,11 @@ static unsigned int dbiIndexRecordFileNumber(dbiIndexSet set, int recno)
 static dbiIndexSet dbiFreeIndexSet(dbiIndexSet set)
 {
     if (set) {
-       set->recs = _free(set->recs);
-       set = _free(set);
+       free(set->recs);
+       memset(set, 0, sizeof(*set)); /* trash and burn */
+       free(set);
     }
-    return set;
+    return NULL;
 }
 
 typedef struct miRE_s {