RPM Package Manager, CVS Repository http://rpm5.org/cvs/ ____________________________________________________________________________
Server: rpm5.org Name: Jeff Johnson Root: /v/rpm/cvs Email: j...@rpm5.org Module: rpm Date: 26-Mar-2009 21:09:04 Branch: HEAD Handle: 2009032620090003 Modified files: rpm CHANGES rpm/build spec.c rpm/lib depends.c formats.c librpm.vers psm.c psm.h rpmal.c rpmds.c rpmds.h rpmfc.c rpmfi.c rpmfi.h rpmgi.h rpmps.h rpmrc.c rpmsx.h rpmte.h rpmts.h tgi.c transaction.c rpm/python header-py.c rpmdb-py.c rpmds-py.c rpm/rpmdb rpmtag.h rpmwf.h rpm/rpmio rpmhash.h rpmio.h rpmmg.h rpmpgp.h rpmxar.h rpm/tools rpmcache.c rpmdeps.c Log: - jbj: use rpmioFreePoolItem for rpmds, eliminate rpmdsFree. Summary: Revision Changes Path 1.2878 +1 -0 rpm/CHANGES 2.199 +4 -2 rpm/build/spec.c 1.437 +28 -16 rpm/lib/depends.c 2.131 +2 -1 rpm/lib/formats.c 1.68 +0 -1 rpm/lib/librpm.vers 2.353 +16 -8 rpm/lib/psm.c 2.72 +2 -2 rpm/lib/psm.h 2.74 +4 -2 rpm/lib/rpmal.c 2.140 +44 -28 rpm/lib/rpmds.c 2.79 +8 -5 rpm/lib/rpmds.h 1.62 +26 -13 rpm/lib/rpmfc.c 2.144 +2 -1 rpm/lib/rpmfi.c 2.73 +2 -2 rpm/lib/rpmfi.h 2.31 +2 -2 rpm/lib/rpmgi.h 2.26 +1 -1 rpm/lib/rpmps.h 2.271 +14 -7 rpm/lib/rpmrc.c 2.18 +2 -2 rpm/lib/rpmsx.h 2.64 +2 -2 rpm/lib/rpmte.h 2.116 +2 -2 rpm/lib/rpmts.h 2.24 +2 -1 rpm/lib/tgi.c 1.399 +2 -1 rpm/lib/transaction.c 1.106 +0 -2 rpm/python/header-py.c 1.25 +0 -1 rpm/python/rpmdb-py.c 1.44 +6 -3 rpm/python/rpmds-py.c 1.60 +2 -2 rpm/rpmdb/rpmtag.h 1.14 +1 -1 rpm/rpmdb/rpmwf.h 1.9 +1 -1 rpm/rpmio/rpmhash.h 1.89 +2 -2 rpm/rpmio/rpmio.h 2.7 +2 -2 rpm/rpmio/rpmmg.h 2.84 +2 -2 rpm/rpmio/rpmpgp.h 2.14 +1 -1 rpm/rpmio/rpmxar.h 2.38 +4 -2 rpm/tools/rpmcache.c 2.21 +4 -2 rpm/tools/rpmdeps.c ____________________________________________________________________________ patch -p0 <<'@@ .' Index: rpm/CHANGES ============================================================================ $ cvs diff -u -r1.2877 -r1.2878 CHANGES --- rpm/CHANGES 26 Mar 2009 18:07:30 -0000 1.2877 +++ rpm/CHANGES 26 Mar 2009 20:09:00 -0000 1.2878 @@ -1,5 +1,6 @@ 5.2a3 -> 5.2a4: + - jbj: use rpmioFreePoolItem for rpmds, eliminate rpmdsFree. - jbj: finish up using rpmioFreePoolItem() for rpmts and Header objects. - devzero2000: continuing for refcount rewrite : add define of fooFree to rpmioFreePoolItem - devzero2000: begin change programming style for refcount : rpmtsFree and headerFree @@ . patch -p0 <<'@@ .' Index: rpm/build/spec.c ============================================================================ $ cvs diff -u -r2.198 -r2.199 spec.c --- rpm/build/spec.c 26 Mar 2009 18:07:31 -0000 2.198 +++ rpm/build/spec.c 26 Mar 2009 20:09:01 -0000 2.199 @@ -191,8 +191,10 @@ pkg->verifyFile = _free(pkg->verifyFile); pkg->sanityCheckFile = _free(pkg->sanityCheckFile); - pkg->header = headerFree(pkg->header); - pkg->ds = rpmdsFree(pkg->ds); + (void)headerFree(pkg->header); + pkg->header = NULL; + (void)rpmdsFree(pkg->ds); + pkg->ds = NULL; pkg->fileList = rpmiobFree(pkg->fileList); pkg->fileFile = _free(pkg->fileFile); if (pkg->cpioList != NULL) { @@ . patch -p0 <<'@@ .' Index: rpm/lib/depends.c ============================================================================ $ cvs diff -u -r1.436 -r1.437 depends.c --- rpm/lib/depends.c 26 Mar 2009 18:07:31 -0000 1.436 +++ rpm/lib/depends.c 26 Mar 2009 20:09:01 -0000 1.437 @@ -170,8 +170,10 @@ rpmds A = rpmdsThis(first, RPMTAG_REQUIRENAME, RPMSENSE_EQUAL); rpmds B = rpmdsThis(second, RPMTAG_REQUIRENAME, RPMSENSE_EQUAL); rc = rpmdsCompare(A, B); - A = rpmdsFree(A); - B = rpmdsFree(B); + (void)rpmdsFree(A); + A = NULL; + (void)rpmdsFree(B); + B = NULL; } one = _free(one); two = _free(two); @@ -499,7 +501,8 @@ } mi = rpmdbFreeIterator(mi); } - obsoletes = rpmdsFree(obsoletes); + (void)rpmdsFree(obsoletes); + obsoletes = NULL; return 0; } @@ -703,8 +706,10 @@ } } pi = rpmtsiFree(pi); - oldChk = rpmdsFree(oldChk); - newChk = rpmdsFree(newChk); + (void)rpmdsFree(oldChk); + oldChk = NULL; + (void)rpmdsFree(newChk); + newChk = NULL; /* If newer (or same) NEVRAO was already added, exit now. */ if (ec) @@ -834,12 +839,14 @@ /*...@globals sysinfo_path, _sysinfo_path, rpmlibP, cpuinfoP, getconfP, unameP @*/ /*...@modifies sysinfo_path, _sysinfo_path, rpmlibP, cpuinfoP, getconfP, unameP @*/ { -/*...@-refcounttrans@*/ - rpmlibP = rpmdsFree(rpmlibP); - cpuinfoP = rpmdsFree(cpuinfoP); - getconfP = rpmdsFree(getconfP); - unameP = rpmdsFree(unameP); -/*...@=refcounttrans@*/ + (void)rpmdsFree(rpmlibP); + rpmlibP = NULL; + (void)rpmdsFree(cpuinfoP); + cpuinfoP = NULL; + (void)rpmdsFree(getconfP); + getconfP = NULL; + (void)rpmdsFree(unameP); + unameP = NULL; /*...@-observertrans@*/ _sysinfo_path = _free(_sysinfo_path); /*...@=observertrans@*/ @@ -1400,7 +1407,8 @@ /* Search using the original {EVR,"",Flags} from the dep set. */ ds = rpmdsSingle(rpmdsTagN(dep), rpmdsEVR(dep), "", Flags); xx = rpmdsSearch(sonameP, ds); - ds = rpmdsFree(ds); + (void)rpmdsFree(ds); + ds = NULL; PRCO = rpmdsFreePRCO(PRCO); /* Was the dependency satisfied? */ @@ -1790,10 +1798,14 @@ requires, conflicts, dirnames, linktos, depName, tscolor, adding); - linktos = rpmdsFree(linktos); - dirnames = rpmdsFree(dirnames); - conflicts = rpmdsFree(conflicts); - requires = rpmdsFree(requires); + (void)rpmdsFree(linktos); + linktos = NULL; + (void)rpmdsFree(dirnames); + dirnames = NULL; + (void)rpmdsFree(conflicts); + conflicts = NULL; + (void)rpmdsFree(requires); + requires = NULL; he->p.str = _free(he->p.str); if (rc > ourrc) @@ . patch -p0 <<'@@ .' Index: rpm/lib/formats.c ============================================================================ $ cvs diff -u -r2.130 -r2.131 formats.c --- rpm/lib/formats.c 31 Jul 2008 02:40:06 -0000 2.130 +++ rpm/lib/formats.c 26 Mar 2009 20:09:01 -0000 2.131 @@ -254,7 +254,8 @@ *t++ = '\0'; } av = argvFree(av); - ds = rpmdsFree(ds); + (void)rpmdsFree(ds); + ds = NULL; he->t = RPM_STRING_ARRAY_TYPE; he->p.argv = argv; @@ . patch -p0 <<'@@ .' Index: rpm/lib/librpm.vers ============================================================================ $ cvs diff -u -r1.67 -r1.68 librpm.vers --- rpm/lib/librpm.vers 26 Mar 2009 18:07:31 -0000 1.67 +++ rpm/lib/librpm.vers 26 Mar 2009 20:09:01 -0000 1.68 @@ -88,7 +88,6 @@ rpmdsExclude; rpmdsFind; rpmdsFlags; - rpmdsFree; rpmdsFreePRCO; rpmdsFromPRCO; rpmdsGetconf; @@ . patch -p0 <<'@@ .' Index: rpm/lib/psm.c ============================================================================ $ cvs diff -u -r2.352 -r2.353 psm.c --- rpm/lib/psm.c 26 Mar 2009 18:07:31 -0000 2.352 +++ rpm/lib/psm.c 26 Mar 2009 20:09:01 -0000 2.353 @@ -1126,7 +1126,8 @@ bingo = 1; /*...@innerbreak@*/ break; } - ds = rpmdsFree(ds); + (void)rpmdsFree(ds); + ds = NULL; xx = mireClean(mire); } @@ -1178,10 +1179,14 @@ } mire = mireFree(mire); - Pds = rpmdsFree(Pds); - Dds = rpmdsFree(Dds); - Fds = rpmdsFree(Fds); - Tds = rpmdsFree(Tds); + (void)rpmdsFree(Pds); + Pds = NULL; + (void)rpmdsFree(Dds); + Dds = NULL; + (void)rpmdsFree(Fds); + Fds = NULL; + (void)rpmdsFree(Tds); + Tds = NULL; exit: Ihe->p.ptr = _free(Ihe->p.ptr); @@ -1304,7 +1309,8 @@ instances = argiFree(instances); depName = _free(depName); - ds = rpmdsFree(ds); + (void)rpmdsFree(ds); + ds = NULL; return rc; } @@ -1445,7 +1451,8 @@ else xx = argvAdd(&keys, N); } - triggers = rpmdsFree(triggers); + (void)rpmdsFree(triggers); + triggers = NULL; /* For all primary keys, retrieve headers and fire triggers. */ if (keys != NULL) @@ -1559,7 +1566,8 @@ psm->IPhe->p.ptr = _free(psm->IPhe->p.ptr); psm->IPhe = _free(psm->IPhe); psm->NVRA = _free(psm->NVRA); - psm->triggers = rpmdsFree(psm->triggers); + (void)rpmdsFree(psm->triggers); + psm->triggers = NULL; /*...@=nullstate@*/ } @@ . patch -p0 <<'@@ .' Index: rpm/lib/psm.h ============================================================================ $ cvs diff -u -r2.71 -r2.72 psm.h --- rpm/lib/psm.h 21 Mar 2009 17:32:45 -0000 2.71 +++ rpm/lib/psm.h 26 Mar 2009 20:09:01 -0000 2.72 @@ -180,7 +180,7 @@ * Unreference a package state machine instance. * @param psm package state machine * @param msg - * @return NULL always + * @return NULL on last dereference */ /*...@unused@*/ /*...@null@*/ rpmpsm rpmpsmUnlink (/*...@killref@*/ /*...@only@*/ /*...@null@*/ rpmpsm psm, @@ -204,7 +204,7 @@ /** * Destroy a package state machine. * @param psm package state machine - * @return NULL always + * @return NULL on last dereference */ /*...@null@*/ rpmpsm rpmpsmFree(/*...@killref@*/ /*...@only@*/ /*...@null@*/ rpmpsm psm, @@ . patch -p0 <<'@@ .' Index: rpm/lib/rpmal.c ============================================================================ $ cvs diff -u -r2.73 -r2.74 rpmal.c --- rpm/lib/rpmal.c 11 Nov 2008 02:42:40 -0000 2.73 +++ rpm/lib/rpmal.c 26 Mar 2009 20:09:01 -0000 2.74 @@ -185,7 +185,8 @@ if ((alp = al->list) != NULL) for (i = 0; i < al->size; i++, alp++) { - alp->provides = rpmdsFree(alp->provides); + (void)rpmdsFree(alp->provides); + alp->provides = NULL; alp->fi = rpmfiFree(alp->fi); } @@ -329,7 +330,8 @@ } } - alp->provides = rpmdsFree(alp->provides); + (void)rpmdsFree(alp->provides); + alp->provides = NULL; alp->fi = rpmfiFree(alp->fi); memset(alp, 0, sizeof(*alp)); /* XXX trash and burn */ @@ . patch -p0 <<'@@ .' Index: rpm/lib/rpmds.c ============================================================================ $ cvs diff -u -r2.139 -r2.140 rpmds.c --- rpm/lib/rpmds.c 26 Mar 2009 18:07:31 -0000 2.139 +++ rpm/lib/rpmds.c 26 Mar 2009 20:09:01 -0000 2.140 @@ -179,12 +179,6 @@ ds->include = mireFreeAll(ds->include, ds->ninclude); } -rpmds rpmdsFree(rpmds ds) -{ - (void)rpmioFreePoolItem((rpmioItem)ds, __FUNCTION__, __FILE__, __LINE__); - return NULL; -} - /*...@unchecked@*/ /*...@null@*/ rpmioPool _rpmdsPool; @@ -1193,7 +1187,8 @@ ds = rpmdsSingle(RPMTAG_PROVIDENAME, t, EVR, Flags); xx = rpmdsMerge(dsp, ds); - ds = rpmdsFree(ds); + (void)rpmdsFree(ds); + ds = NULL; } #if defined(SUPPORT_LIBCPUINFO) @@ -1524,7 +1519,8 @@ rpmds ds = rpmdsSingle(RPMTAG_PROVIDENAME, rlp->featureName, rlp->featureEVR, rlp->featureFlags); xx = rpmdsMerge(dsp, ds); - ds = rpmdsFree(ds); + (void)rpmdsFree(ds); + ds = NULL; } return 0; } @@ -1646,7 +1642,8 @@ ds = rpmdsSingle(tagN, N, EVR , Flags); if (ds) { /* XXX can't happen */ xx = rpmdsMergePRCO(PRCO, ds); - ds = rpmdsFree(ds); + (void)rpmdsFree(ds); + ds = NULL; } } rc = 0; @@ -2775,14 +2772,22 @@ rpmPRCO rpmdsFreePRCO(rpmPRCO PRCO) { if (PRCO) { - PRCO->this = rpmdsFree(PRCO->this); - PRCO->P = rpmdsFree(PRCO->P); - PRCO->R = rpmdsFree(PRCO->R); - PRCO->C = rpmdsFree(PRCO->C); - PRCO->O = rpmdsFree(PRCO->O); - PRCO->T = rpmdsFree(PRCO->T); - PRCO->D = rpmdsFree(PRCO->D); - PRCO->L = rpmdsFree(PRCO->L); + (void)rpmdsFree(PRCO->this); + PRCO->this = NULL; + (void)rpmdsFree(PRCO->P); + PRCO->P = NULL; + (void)rpmdsFree(PRCO->R); + PRCO->R = NULL; + (void)rpmdsFree(PRCO->C); + PRCO->C = NULL; + (void)rpmdsFree(PRCO->O); + PRCO->O = NULL; + (void)rpmdsFree(PRCO->T); + PRCO->T = NULL; + (void)rpmdsFree(PRCO->D); + PRCO->D = NULL; + (void)rpmdsFree(PRCO->L); + PRCO->L = NULL; memset(PRCO, 0, sizeof(*PRCO)); PRCO = _free(PRCO); } @@ -2980,7 +2985,8 @@ sonameDep(t, buf, isElf64), "", RPMSENSE_FIND_PROVIDES); xx = add(context, ds); - ds = rpmdsFree(ds); + (void)rpmdsFree(ds); + ds = NULL; } auxoffset += aux->vda_next; } @@ -3032,7 +3038,8 @@ sonameDep(t, buf, isElf64), "", RPMSENSE_FIND_REQUIRES); xx = add(context, ds); - ds = rpmdsFree(ds); + (void)rpmdsFree(ds); + ds = NULL; } auxoffset += aux->vna_next; } @@ -3073,7 +3080,8 @@ sonameDep(buf, s, isElf64), "", RPMSENSE_FIND_REQUIRES); xx = add(context, ds); - ds = rpmdsFree(ds); + (void)rpmdsFree(ds); + ds = NULL; /*...@switchbreak@*/ break; case DT_SONAME: gotSONAME = 1; @@ -3087,7 +3095,8 @@ sonameDep(buf, s, isElf64), "", RPMSENSE_FIND_PROVIDES); xx = add(context, ds); - ds = rpmdsFree(ds); + (void)rpmdsFree(ds); + ds = NULL; /*...@switchbreak@*/ break; } } @@ -3103,7 +3112,8 @@ ds = rpmdsSingle(RPMTAG_REQUIRENAME, "rtld(GNU_HASH)", "", RPMSENSE_FIND_REQUIRES); xx = add(context, ds); - ds = rpmdsFree(ds); + (void)rpmdsFree(ds); + ds = NULL; } /* For DSO's, provide the basename of the file if DT_SONAME not found. */ @@ -3120,7 +3130,8 @@ ds = rpmdsSingle(RPMTAG_PROVIDENAME, sonameDep(buf, s, isElf64), "", RPMSENSE_FIND_PROVIDES); xx = add(context, ds); - ds = rpmdsFree(ds); + (void)rpmdsFree(ds); + ds = NULL; } exit: @@ -3256,7 +3267,8 @@ Flags |= RPMSENSE_PROBE; ds = rpmdsSingle(RPMTAG_PROVIDENAME, N, EVR, Flags); xx = rpmdsMerge(PRCO->Pdsp, ds); - ds = rpmdsFree(ds); + (void)rpmdsFree(ds); + ds = NULL; xx = rpmdsELF(DSOfn, 0, rpmdsMergePRCO, PRCO); } @@ -3364,7 +3376,8 @@ Flags |= RPMSENSE_PROBE; ds = rpmdsSingle(RPMTAG_PROVIDENAME, N, EVR, Flags); xx = rpmdsMerge(PRCO->Pdsp, ds); - ds = rpmdsFree(ds); + (void)rpmdsFree(ds); + ds = NULL; xx = rpmdsELF(DSOfn, 0, rpmdsMergePRCO, PRCO); } @@ -3612,7 +3625,8 @@ Flags |= RPMSENSE_PROBE; ds = rpmdsSingle(tagN, N, EVR, Flags); xx = rpmdsMerge(dsp, ds); - ds = rpmdsFree(ds); + (void)rpmdsFree(ds); + ds = NULL; } rc = 0; @@ -3858,7 +3872,8 @@ break; exit: - provides = rpmdsFree(provides); + (void)rpmdsFree(provides); + provides = NULL; return result; } @@ -3930,7 +3945,8 @@ if (nopromote) (void) rpmdsSetNoPromote(pkg, nopromote); result = rpmdsCompare(pkg, req); - pkg = rpmdsFree(pkg); + (void)rpmdsFree(pkg); + pkg = NULL; } pkgN = _free(pkgN); @@ . patch -p0 <<'@@ .' Index: rpm/lib/rpmds.h ============================================================================ $ cvs diff -u -r2.78 -r2.79 rpmds.h --- rpm/lib/rpmds.h 20 Mar 2009 18:28:33 -0000 2.78 +++ rpm/lib/rpmds.h 26 Mar 2009 20:09:01 -0000 2.79 @@ -128,14 +128,14 @@ * Unreference a dependency set instance. * @param ds dependency set * @param msg - * @return NULL always + * @return NULL on last dereference */ /*...@unused@*/ /*...@null@*/ rpmds rpmdsUnlink (/*...@killref@*/ /*...@only@*/ /*...@null@*/ rpmds ds, /*...@null@*/ const char * msg) /*...@modifies ds @*/; #define rpmdsUnlink(_ds, _msg) \ - ((rpmds)rpmioUnlinkPoolItem((rpmioItem)(_ds), _msg, __FILE__, __LINE__)) + ((rpmds)rpmioUnlinkPoolItem((rpmioItem)(_ds), _msg, __FILE__, __LINE__)) /** \ingroup rpmds * Reference a dependency set instance. @@ -147,16 +147,19 @@ rpmds rpmdsLink (/*...@null@*/ rpmds ds, /*...@null@*/ const char * msg) /*...@modifies ds @*/; #define rpmdsLink(_ds, _msg) \ - ((rpmds)rpmioLinkPoolItem((rpmioItem)(_ds), _msg, __FILE__, __LINE__)) + ((rpmds)rpmioLinkPoolItem((rpmioItem)(_ds), _msg, __FILE__, __LINE__)) /** \ingroup rpmds * Destroy a dependency set. * @param ds dependency set - * @return NULL always + * @return NULL on last dereference */ /*...@null@*/ -rpmds rpmdsFree(/*...@killref@*/ /*...@only@*/ /*...@null@*/ rpmds ds) +rpmds rpmdsFree(/*...@killref@*/ /*...@null@*/ rpmds ds) /*...@modifies ds @*/; +#define rpmdsFree(_ds) \ + ((rpmds)rpmioFreePoolItem((rpmioItem)(_ds), __FUNCTION__, __FILE__, __LINE__)) + /** \ingroup rpmds * Create and load a dependency set. * @param h header @@ . patch -p0 <<'@@ .' Index: rpm/lib/rpmfc.c ============================================================================ $ cvs diff -u -r1.61 -r1.62 rpmfc.c --- rpm/lib/rpmfc.c 25 Mar 2009 13:38:42 -0000 1.61 +++ rpm/lib/rpmfc.c 26 Mar 2009 20:09:01 -0000 1.62 @@ -503,7 +503,8 @@ "rpmlib(VersionedDependencies)", "3.0.3-1", RPMSENSE_RPMLIB|(RPMSENSE_LESS|RPMSENSE_EQUAL)); xx = rpmdsMerge(&fc->requires, ds); - ds = rpmdsFree(ds); + (void)rpmdsFree(ds); + ds = NULL; fc->tracked = 1; } @@ -515,7 +516,8 @@ /* Add to file dependencies. */ xx = rpmfcSaveArg(&fc->ddict, rpmfcFileDep(buf, fc->ix, ds)); - ds = rpmdsFree(ds); + (void)rpmdsFree(ds); + ds = NULL; } pav = argvFree(pav); @@ -788,7 +790,8 @@ /* Add to file requires. */ xx = rpmfcSaveArg(&fc->ddict, rpmfcFileDep(se, fc->ix, ds)); - ds = rpmdsFree(ds); + (void)rpmdsFree(ds); + ds = NULL; } /* Set color based on interpreter name. */ @@ -1074,13 +1077,15 @@ skipping = fc->skipProv; ds = rpmdsSingle(RPMTAG_PROVIDENAME, N, EVR, Flags); dix = rpmdsFind(fc->provides, ds); - ds = rpmdsFree(ds); + (void)rpmdsFree(ds); + ds = NULL; /*...@switchbreak@*/ break; case 'R': skipping = fc->skipReq; ds = rpmdsSingle(RPMTAG_REQUIRENAME, N, EVR, Flags); dix = rpmdsFind(fc->requires, ds); - ds = rpmdsFree(ds); + (void)rpmdsFree(ds); + ds = NULL; /*...@switchbreak@*/ break; } @@ -1327,7 +1332,8 @@ for (dm = DepMsgs; dm->msg != NULL; dm++) { if ((int)dm->ntag != -1) { - ds = rpmdsFree(ds); + (void)rpmdsFree(ds); + ds = NULL; ds = rpmdsNew(h, dm->ntag, flags); } if (dm->ftag == 0) @@ -1355,7 +1361,8 @@ if (bingo) rpmlog(RPMLOG_NOTICE, "\n"); } - ds = rpmdsFree(ds); + (void)rpmdsFree(ds); + ds = NULL; } /** @@ -1614,7 +1621,8 @@ if (!fc->skipProv) { ds = rpmdsNew(pkg->header, RPMTAG_PROVIDENAME, flags); xx = rpmdsMerge(&fc->provides, ds); - ds = rpmdsFree(ds); + (void)rpmdsFree(ds); + ds = NULL; he->tag = RPMTAG_PROVIDENAME; xx = headerDel(pkg->header, he, 0); he->tag = RPMTAG_PROVIDEVERSION; @@ -1632,14 +1640,16 @@ ds = rpmdsSingle(RPMTAG_PROVIDENAME, buf, EVR, (RPMSENSE_EQUAL|RPMSENSE_CONFIG)); xx = rpmdsMerge(&fc->provides, ds); - ds = rpmdsFree(ds); + (void)rpmdsFree(ds); + ds = NULL; } } if (!fc->skipReq) { ds = rpmdsNew(pkg->header, RPMTAG_REQUIRENAME, flags); xx = rpmdsMerge(&fc->requires, ds); - ds = rpmdsFree(ds); + (void)rpmdsFree(ds); + ds = NULL; he->tag = RPMTAG_REQUIRENAME; xx = headerDel(pkg->header, he, 0); he->tag = RPMTAG_REQUIREVERSION; @@ -1657,7 +1667,8 @@ ds = rpmdsSingle(RPMTAG_REQUIRENAME, buf, EVR, (RPMSENSE_EQUAL|RPMSENSE_CONFIG)); xx = rpmdsMerge(&fc->requires, ds); - ds = rpmdsFree(ds); + (void)rpmdsFree(ds); + ds = NULL; } } @@ -1811,8 +1822,10 @@ fc->ddict = argvFree(fc->ddict); fc->ddictx = argiFree(fc->ddictx); - fc->provides = rpmdsFree(fc->provides); - fc->requires = rpmdsFree(fc->requires); + (void)rpmdsFree(fc->provides); + fc->provides = NULL; + (void)rpmdsFree(fc->requires); + fc->requires = NULL; fc->iob_java = rpmiobFree(fc->iob_java); fc->iob_perl = rpmiobFree(fc->iob_perl); @@ . patch -p0 <<'@@ .' Index: rpm/lib/rpmfi.c ============================================================================ $ cvs diff -u -r2.143 -r2.144 rpmfi.c --- rpm/lib/rpmfi.c 26 Mar 2009 18:07:31 -0000 2.143 +++ rpm/lib/rpmfi.c 26 Mar 2009 20:09:01 -0000 2.144 @@ -2110,7 +2110,8 @@ exit: fi = rpmfiFree(fi); - ds = rpmdsFree(ds); + (void)rpmdsFree(ds); + ds = NULL; if (fdepsp) *fdepsp = av; else @@ . patch -p0 <<'@@ .' Index: rpm/lib/rpmfi.h ============================================================================ $ cvs diff -u -r2.72 -r2.73 rpmfi.h --- rpm/lib/rpmfi.h 21 Mar 2009 20:54:23 -0000 2.72 +++ rpm/lib/rpmfi.h 26 Mar 2009 20:09:01 -0000 2.73 @@ -251,7 +251,7 @@ * Unreference a file info set instance. * @param fi file info set * @param msg - * @return NULL always + * @return NULL on last dereference */ /*...@unused@*/ /*...@null@*/ rpmfi rpmfiUnlink (/*...@killref@*/ /*...@only@*/ /*...@null@*/ rpmfi fi, @@ -637,7 +637,7 @@ /** * Destroy a file info set. * @param fi file info set - * @return NULL always + * @return NULL on last dereference */ /*...@null@*/ rpmfi rpmfiFree(/*...@killref@*/ /*...@only@*/ /*...@null@*/ rpmfi fi) @@ . patch -p0 <<'@@ .' Index: rpm/lib/rpmgi.h ============================================================================ $ cvs diff -u -r2.30 -r2.31 rpmgi.h --- rpm/lib/rpmgi.h 21 Mar 2009 20:25:42 -0000 2.30 +++ rpm/lib/rpmgi.h 26 Mar 2009 20:09:01 -0000 2.31 @@ -93,7 +93,7 @@ * Unreference a generalized iterator instance. * @param gi generalized iterator * @param msg - * @return NULL always + * @return NULL on last dereference */ /*...@unused@*/ /*...@null@*/ rpmgi rpmgiUnlink (/*...@killref@*/ /*...@only@*/ /*...@null@*/ rpmgi gi, @@ -116,7 +116,7 @@ /** Destroy a generalized iterator. * @param gi generalized iterator - * @return NULL always + * @return NULL on last dereference */ /*...@null@*/ rpmgi rpmgiFree(/*...@killref@*/ /*...@only@*/ /*...@null@*/ rpmgi gi) @@ . patch -p0 <<'@@ .' Index: rpm/lib/rpmps.h ============================================================================ $ cvs diff -u -r2.25 -r2.26 rpmps.h --- rpm/lib/rpmps.h 20 Mar 2009 18:28:33 -0000 2.25 +++ rpm/lib/rpmps.h 26 Mar 2009 20:09:01 -0000 2.26 @@ -189,7 +189,7 @@ /** * Destroy a problem set. * @param ps problem set - * @return NULL always + * @return NULL on last dereference */ /*...@null@*/ rpmps rpmpsFree(/*...@killref@*/ /*...@only@*/ /*...@null@*/ rpmps ps) @@ . patch -p0 <<'@@ .' Index: rpm/lib/rpmrc.c ============================================================================ $ cvs diff -u -r2.270 -r2.271 rpmrc.c --- rpm/lib/rpmrc.c 19 Mar 2009 17:46:23 -0000 2.270 +++ rpm/lib/rpmrc.c 26 Mar 2009 20:09:01 -0000 2.271 @@ -507,7 +507,8 @@ { rpmds cpufeature = rpmdsSingle(RPMTAG_REQUIRENAME, feature, EVR, RPMSENSE_PROBE); int ret = rpmdsMatch(cpufeature, cpuinfo); - cpufeature = rpmdsFree(cpufeature); + (void)rpmdsFree(cpufeature); + cpufeature = NULL; return ret; } @@ -579,7 +580,8 @@ xx = mireAppend(RPMMIRE_REGEX, 0, "noarch", NULL, &mi_re, &mi_nre); - cpuinfo = rpmdsFree(cpuinfo); + (void)rpmdsFree(cpuinfo); + cpuinfo = NULL; cpu = mi_re[0].pattern; if(cpu != NULL) @@ -1177,7 +1179,8 @@ if (DNEVR != NULL) fprintf(fp, " %s\n", DNEVR+2); } - ds = rpmdsFree(ds); + (void)rpmdsFree(ds); + ds = NULL; fprintf(fp, "\n"); } PRCO = rpmdsFreePRCO(PRCO); @@ -1192,7 +1195,8 @@ if (DNEVR != NULL) fprintf(fp, " %s\n", DNEVR+2); } - ds = rpmdsFree(ds); + (void)rpmdsFree(ds); + ds = NULL; fprintf(fp, "\n"); xx = rpmdsCpuinfo(&ds, NULL); @@ -1210,7 +1214,8 @@ if (DNEVR != NULL) fprintf(fp, " %s\n", DNEVR+2); } - ds = rpmdsFree(ds); + (void)rpmdsFree(ds); + ds = NULL; fprintf(fp, "\n"); } } @@ -1226,7 +1231,8 @@ if (DNEVR != NULL) fprintf(fp, " %s\n", DNEVR+2); } - ds = rpmdsFree(ds); + (void)rpmdsFree(ds); + ds = NULL; fprintf(fp, "\n"); } @@ -1240,7 +1246,8 @@ if (DNEVR != NULL) fprintf(fp, " %s\n", DNEVR+2); } - ds = rpmdsFree(ds); + (void)rpmdsFree(ds); + ds = NULL; fprintf(fp, "\n"); } } @@ . patch -p0 <<'@@ .' Index: rpm/lib/rpmsx.h ============================================================================ $ cvs diff -u -r2.17 -r2.18 rpmsx.h --- rpm/lib/rpmsx.h 21 Mar 2009 21:53:40 -0000 2.17 +++ rpm/lib/rpmsx.h 26 Mar 2009 20:09:01 -0000 2.18 @@ -83,7 +83,7 @@ * Unreference a security context patterns instance. * @param sx security context patterns * @param msg - * @return NULL always + * @return NULL on last dereference */ /*...@unused@*/ /*...@null@*/ rpmsx rpmsxUnlink (/*...@killref@*/ /*...@only@*/ /*...@null@*/ rpmsx sx, @@ -107,7 +107,7 @@ /** * Destroy a security context patterns. * @param sx security context patterns - * @return NULL always + * @return NULL on last dereference */ /*...@null@*/ rpmsx rpmsxFree(/*...@killref@*/ /*...@only@*/ /*...@null@*/ rpmsx sx) @@ . patch -p0 <<'@@ .' Index: rpm/lib/rpmte.h ============================================================================ $ cvs diff -u -r2.63 -r2.64 rpmte.h --- rpm/lib/rpmte.h 21 Mar 2009 21:53:40 -0000 2.63 +++ rpm/lib/rpmte.h 26 Mar 2009 20:09:01 -0000 2.64 @@ -200,7 +200,7 @@ /** \ingroup rpmte * Destroy a transaction element. * @param te transaction element - * @return NULL always + * @return NULL on last dereference */ /*...@unused@*/ /*...@null@*/ rpmte rpmteFree(/*...@only@*/ /*...@null@*/ rpmte te) @@ -676,7 +676,7 @@ /** \ingroup rpmte * Destroy transaction element iterator. * @param tsi transaction element iterator - * @return NULL always + * @return NULL on last dereference */ /*...@unused@*/ /*...@null@*/ rpmtsi rpmtsiFree(/*...@killref@*//*...@null@*/ rpmtsi tsi) @@ . patch -p0 <<'@@ .' Index: rpm/lib/rpmts.h ============================================================================ $ cvs diff -u -r2.115 -r2.116 rpmts.h --- rpm/lib/rpmts.h 26 Mar 2009 18:07:31 -0000 2.115 +++ rpm/lib/rpmts.h 26 Mar 2009 20:09:01 -0000 2.116 @@ -395,7 +395,7 @@ * Unreference a transaction instance. * @param ts transaction set * @param msg - * @return NULL always + * @return NULL on last dereference */ /*...@unused@*/ /*...@null@*/ rpmts rpmtsUnlink (/*...@killref@*/ /*...@only@*/ rpmts ts, @@ -622,7 +622,7 @@ /** \ingroup rpmts * Destroy transaction set, closing the database as well. * @param ts transaction set - * @return NULL always + * @return NULL on last dereference */ /*...@null@*/ rpmts rpmtsFree(/*...@killref@*/ /*...@null@*/ rpmts ts) @@ . patch -p0 <<'@@ .' Index: rpm/lib/tgi.c ============================================================================ $ cvs diff -u -r2.23 -r2.24 tgi.c --- rpm/lib/tgi.c 26 Mar 2009 18:07:31 -0000 2.23 +++ rpm/lib/tgi.c 26 Mar 2009 20:09:01 -0000 2.24 @@ -213,7 +213,8 @@ fileURL = NULL; pkgx++; } - this = rpmdsFree(this); + (void)rpmdsFree(this); + this = NULL; } else #endif @@ . patch -p0 <<'@@ .' Index: rpm/lib/transaction.c ============================================================================ $ cvs diff -u -r1.398 -r1.399 transaction.c --- rpm/lib/transaction.c 26 Mar 2009 18:07:31 -0000 1.398 +++ rpm/lib/transaction.c 26 Mar 2009 20:09:01 -0000 1.399 @@ -636,7 +636,8 @@ req = rpmdsSingle(RPMTAG_REQUIRENAME, rpmteN(p), reqEVR, reqFlags); rc = rpmdsNVRMatchesDep(h, req, _rpmds_nopromote); - req = rpmdsFree(req); + (void)rpmdsFree(req); + req = NULL; if (rc == 0) { rpmps ps = rpmtsProblems(ts); @@ . patch -p0 <<'@@ .' Index: rpm/python/header-py.c ============================================================================ $ cvs diff -u -r1.105 -r1.106 header-py.c --- rpm/python/header-py.c 26 Mar 2009 18:07:33 -0000 1.105 +++ rpm/python/header-py.c 26 Mar 2009 20:09:02 -0000 1.106 @@ -25,8 +25,6 @@ #include "debug.h" -#define headerFree() rpmioFreePoolItem() - /** \ingroup python * \class Rpm * \brief START HERE / RPM base module for the Python API @@ . patch -p0 <<'@@ .' Index: rpm/python/rpmdb-py.c ============================================================================ $ cvs diff -u -r1.24 -r1.25 rpmdb-py.c --- rpm/python/rpmdb-py.c 26 Mar 2009 18:07:33 -0000 1.24 +++ rpm/python/rpmdb-py.c 26 Mar 2009 20:09:02 -0000 1.25 @@ -14,7 +14,6 @@ #include "header-py.h" #include "debug.h" -#define headerFree() rpmioFreePoolItem() /*...@access Header @*/ @@ . patch -p0 <<'@@ .' Index: rpm/python/rpmds-py.c ============================================================================ $ cvs diff -u -r1.43 -r1.44 rpmds-py.c --- rpm/python/rpmds-py.c 31 Jul 2008 00:21:42 -0000 1.43 +++ rpm/python/rpmds-py.c 26 Mar 2009 20:09:02 -0000 1.44 @@ -338,7 +338,8 @@ rpmds nds = NULL; if (rpmdsMerge(&nds, s->ds) >= 0) { - s->ds = rpmdsFree(s->ds); + (void)rpmdsFree(s->ds); + s->ds = NULL; s->ds = nds; } Py_INCREF(Py_None); @@ -592,7 +593,8 @@ /*...@modifies s @*/ { if (s) { - s->ds = rpmdsFree(s->ds); + (void)rpmdsFree(s->ds); + s->ds = NULL; PyObject_Del(s); } } @@ -694,7 +696,8 @@ { if (_rpmds_debug) fprintf(stderr, "%p -- ds %p\n", s, s->ds); - s->ds = rpmdsFree(s->ds); + (void)rpmdsFree(s->ds); + s->ds = NULL; PyObject_Del((PyObject *)s); } @@ . patch -p0 <<'@@ .' Index: rpm/rpmdb/rpmtag.h ============================================================================ $ cvs diff -u -r1.59 -r1.60 rpmtag.h --- rpm/rpmdb/rpmtag.h 26 Mar 2009 18:07:33 -0000 1.59 +++ rpm/rpmdb/rpmtag.h 26 Mar 2009 20:09:03 -0000 1.60 @@ -817,7 +817,7 @@ /** \ingroup header * Dereference a header instance. * @param h header - * @return NULL always + * @return NULL on last dereference */ /*...@null@*/ Header headerUnlink(/*...@killref@*/ /*...@null@*/ Header h) @@ -828,7 +828,7 @@ /** \ingroup header * Dereference a header instance. * @param h header - * @return NULL always + * @return NULL on last dereference */ /*...@null@*/ Header headerFree(/*...@killref@*/ /*...@null@*/ Header h) @@ . patch -p0 <<'@@ .' Index: rpm/rpmdb/rpmwf.h ============================================================================ $ cvs diff -u -r1.13 -r1.14 rpmwf.h --- rpm/rpmdb/rpmwf.h 24 Mar 2009 19:30:22 -0000 1.13 +++ rpm/rpmdb/rpmwf.h 26 Mar 2009 20:09:03 -0000 1.14 @@ -71,7 +71,7 @@ * Unreference a wrapper format instance. * @param wf wrapper format * @param msg - * @return NULL always + * @return NULL on last dereference */ /*...@unused@*/ /*...@null@*/ rpmwf rpmwfUnlink (/*...@killref@*/ /*...@only@*/ /*...@null@*/ rpmwf wf, @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/rpmhash.h ============================================================================ $ cvs diff -u -r1.8 -r1.9 rpmhash.h --- rpm/rpmio/rpmhash.h 25 Mar 2009 20:26:46 -0000 1.8 +++ rpm/rpmio/rpmhash.h 26 Mar 2009 20:09:03 -0000 1.9 @@ -115,7 +115,7 @@ /** * Destroy hash table. * @param ht pointer to hash table - * @return NULL always + * @return NULL on last dereference */ /*...@null@*/ hashTable htFree( /*...@only@*/ hashTable ht) @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/rpmio.h ============================================================================ $ cvs diff -u -r1.88 -r1.89 rpmio.h --- rpm/rpmio/rpmio.h 25 Mar 2009 20:26:46 -0000 1.88 +++ rpm/rpmio/rpmio.h 26 Mar 2009 20:09:03 -0000 1.89 @@ -755,7 +755,7 @@ * @param msg debugging msg (NULL disables debugging) * @param fn usually __FILE__ * @param ln usually __LINE__ - * @return pool item + * @return pool item (NULL on last dereference) */ /*...@null@*/ rpmioItem rpmioUnlinkPoolItem(/*...@killref@*/ /*...@null@*/ rpmioItem item, @@ -783,7 +783,7 @@ * @param msg debugging msg (NULL disables debugging) * @param fn usually __FILE__ * @param ln usually __LINE__ - * @return pool item + * @return pool item (NULL on last dereference) */ /*...@null@*/ void * rpmioFreePoolItem(/*...@killref@*/ /*...@null@*/ rpmioItem item, @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/rpmmg.h ============================================================================ $ cvs diff -u -r2.6 -r2.7 rpmmg.h --- rpm/rpmio/rpmmg.h 25 Mar 2009 20:26:47 -0000 2.6 +++ rpm/rpmio/rpmmg.h 26 Mar 2009 20:09:03 -0000 2.7 @@ -38,7 +38,7 @@ /** * Unreference a magic wrapper instance. * @param mg magic wrapper - * @return + * @return NULL on last dereference */ /*...@unused@*/ /*...@null@*/ rpmmg rpmmgUnlink (/*...@killref@*/ /*...@only@*/ /*...@null@*/ rpmmg mg) @@ -60,7 +60,7 @@ /** * Destroy a magic wrapper. * @param mg magic wrapper - * @return NULL always + * @return NULL on last dereference */ /*...@null@*/ rpmmg rpmmgFree(/*...@killref@*/ /*...@null@*/rpmmg mg) @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/rpmpgp.h ============================================================================ $ cvs diff -u -r2.83 -r2.84 rpmpgp.h --- rpm/rpmio/rpmpgp.h 25 Mar 2009 20:26:47 -0000 2.83 +++ rpm/rpmio/rpmpgp.h 26 Mar 2009 20:09:03 -0000 2.84 @@ -1357,7 +1357,7 @@ * Unreference a signature parameters instance. * @param dig signature parameters * @param msg - * @return NULL always + * @return NULL on last dereference */ /*...@unused@*/ /*...@null@*/ pgpDig pgpDigUnlink (/*...@killref@*/ /*...@only@*/ /*...@null@*/ pgpDig dig, @@ -1381,7 +1381,7 @@ /** \ingroup rpmpgp * Destroy a container for parsed OpenPGP packates. * @param dig signature parameters container - * @return NULL always + * @return NULL on last dereference */ /*...@unused@*/ /*...@null@*/ pgpDig pgpDigFree(/*...@killref@*/ /*...@only@*/ /*...@null@*/ pgpDig dig) @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/rpmxar.h ============================================================================ $ cvs diff -u -r2.13 -r2.14 rpmxar.h --- rpm/rpmio/rpmxar.h 25 Mar 2009 20:26:47 -0000 2.13 +++ rpm/rpmio/rpmxar.h 26 Mar 2009 20:09:03 -0000 2.14 @@ -45,7 +45,7 @@ * Unreference a xar archive instance. * @param xar xar archive * @param msg - * @return NULL always + * @return NULL on last dereference */ /*...@unused@*/ /*...@null@*/ rpmxar rpmxarUnlink (/*...@killref@*/ /*...@only@*/ /*...@null@*/ rpmxar xar, @@ . patch -p0 <<'@@ .' Index: rpm/tools/rpmcache.c ============================================================================ $ cvs diff -u -r2.37 -r2.38 rpmcache.c --- rpm/tools/rpmcache.c 26 Mar 2009 18:07:34 -0000 2.37 +++ rpm/tools/rpmcache.c 26 Mar 2009 20:09:03 -0000 2.38 @@ -63,7 +63,8 @@ static inline Item freeItem(Item item) { if (item != NULL) { item->path = _free(item->path); - item->this = rpmdsFree(item->this); + (void)rpmdsFree(item->this); + item->this = NULL; (void)headerFree(item->h); item->h = NULL; item = _free(item); @@ -285,7 +286,8 @@ #endif exit: - add = rpmdsFree(add); + (void)rpmdsFree(add); + add = NULL; return (ec ? RPMRC_NOTFOUND : RPMRC_OK); } @@ . patch -p0 <<'@@ .' Index: rpm/tools/rpmdeps.c ============================================================================ $ cvs diff -u -r2.20 -r2.21 rpmdeps.c --- rpm/tools/rpmdeps.c 22 Sep 2008 15:14:55 -0000 2.20 +++ rpm/tools/rpmdeps.c 26 Mar 2009 20:09:03 -0000 2.21 @@ -439,8 +439,10 @@ } fc = rpmfcFree(fc); - P = rpmdsFree(P); - R = rpmdsFree(R); + (void)rpmdsFree(P); + P = NULL; + (void)rpmdsFree(R); + R = NULL; PRCO = rpmdsFreePRCO(PRCO); ec = 0; @@ . ______________________________________________________________________ RPM Package Manager http://rpm5.org CVS Sources Repository rpm-cvs@rpm5.org