From bc059725442a69594878b8fa182c8495ca27df59 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Mon, 6 Jun 2011 13:10:32 +0300 Subject: [PATCH] Return explicit NULL from dbiFreeIndexSet() - 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 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/rpmdb.c b/lib/rpmdb.c index 7bb7068..c124fb1 100644 --- a/lib/rpmdb.c +++ b/lib/rpmdb.c @@ -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 { -- 2.7.4