From fb50c97efa2db8a7d490cabf133cefb9698597a1 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Fri, 27 May 2011 12:31:01 +0300 Subject: [PATCH] Don't bother NULL'ing everything on rpmfcFree() - Replace umphteen dead NULL-assignments with a trash-n-burn memset() - Since we're already testing for NULL, dont free NULL fc (not that it matters) --- build/rpmfc.c | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/build/rpmfc.c b/build/rpmfc.c index 5a974b1..8b2434b 100644 --- a/build/rpmfc.c +++ b/build/rpmfc.c @@ -782,24 +782,25 @@ rpmfc rpmfcFree(rpmfc fc) if (fc) { for (rpmfcAttr *attr = fc->atypes; attr && *attr; attr++) rpmfcAttrFree(*attr); - rfree(fc->atypes); - rfree(fc->buildRoot); - fc->fn = argvFree(fc->fn); + free(fc->atypes); + free(fc->buildRoot); + argvFree(fc->fn); for (int i = 0; i < fc->nfiles; i++) argvFree(fc->fattrs[i]); - fc->fattrs = _free(fc->fattrs); - fc->fcolor = argiFree(fc->fcolor); - fc->fcdictx = argiFree(fc->fcdictx); - fc->fddictx = argiFree(fc->fddictx); - fc->fddictn = argiFree(fc->fddictn); - fc->cdict = argvFree(fc->cdict); - fc->ddict = argvFree(fc->ddict); - fc->ddictx = argiFree(fc->ddictx); - - fc->provides = rpmdsFree(fc->provides); - fc->requires = rpmdsFree(fc->requires); + free(fc->fattrs); + argiFree(fc->fcolor); + argiFree(fc->fcdictx); + argiFree(fc->fddictx); + argiFree(fc->fddictn); + argvFree(fc->cdict); + argvFree(fc->ddict); + argiFree(fc->ddictx); + + rpmdsFree(fc->provides); + rpmdsFree(fc->requires); + memset(fc, 0, sizeof(*fc)); /* trash and burn */ + free(fc); } - fc = _free(fc); return NULL; } -- 2.7.4