diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2010-09-21 14:26:29 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2010-09-21 14:26:29 +0300 |
commit | e3e69b44e53c8631004a9624dc39748340316673 (patch) | |
tree | 09590483b4d9a4b3dba34f9202ccc2fec1ed955d | |
parent | a43c15eadfbf18dd4df8d21415f1ef1a7c11f432 (diff) | |
download | rpm-e3e69b44e53c8631004a9624dc39748340316673.tar.gz rpm-e3e69b44e53c8631004a9624dc39748340316673.tar.bz2 rpm-e3e69b44e53c8631004a9624dc39748340316673.zip |
Return explicit NULL from various fooFree() functions everywhere
-rw-r--r-- | build/spec.c | 6 | ||||
-rw-r--r-- | lib/fsm.c | 6 | ||||
-rw-r--r-- | lib/rpmts.c | 6 |
3 files changed, 12 insertions, 6 deletions
diff --git a/build/spec.c b/build/spec.c index a0749bfd0..0159c2077 100644 --- a/build/spec.c +++ b/build/spec.c @@ -167,7 +167,8 @@ static inline speclines freeSl(speclines sl) for (i = 0; i < sl->sl_nlines; i++) sl->sl_lines[i] = _free(sl->sl_lines[i]); sl->sl_lines = _free(sl->sl_lines); - return _free(sl); + _free(sl); + return NULL; } /** @@ -182,7 +183,8 @@ static inline spectags freeSt(spectags st) t->t_msgid = _free(t->t_msgid); } st->st_t = _free(st->st_t); - return _free(st); + _free(st); + return NULL; } rpmSpec newSpec(void) @@ -544,8 +544,9 @@ static hardLink_t freeHardLink(hardLink_t li) if (li) { li->nsuffix = _free(li->nsuffix); /* XXX elements are shared */ li->filex = _free(li->filex); + _free(li); } - return _free(li); + return NULL; } FSM_t newFSM(cpioMapFlags mapflags) @@ -567,8 +568,9 @@ FSM_t freeFSM(FSM_t fsm) fsm->dnlx = _free(fsm->dnlx); fsm->ldn = _free(fsm->ldn); fsm->iter = mapFreeIterator(fsm->iter); + _free(fsm); } - return _free(fsm); + return NULL; } /* forward declaration*/ diff --git a/lib/rpmts.c b/lib/rpmts.c index 380ff00c3..c6c846f0f 100644 --- a/lib/rpmts.c +++ b/lib/rpmts.c @@ -955,9 +955,11 @@ rpmts rpmtsCreate(void) rpmtsi rpmtsiFree(rpmtsi tsi) { /* XXX watchout: a funky recursion segfaults here iff nrefs is wrong. */ - if (tsi) + if (tsi) { tsi->ts = rpmtsFree(tsi->ts); - return _free(tsi); + _free(tsi); + } + return NULL; } rpmtsi rpmtsiInit(rpmts ts) |