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 19:07:34 Branch: HEAD Handle: 2009032618073004 Modified files: rpm CHANGES devtool.conf rpmqv.c rpm/build pack.c spec.c rpm/lib depends.c fsm.c librpm.vers package.c psm.c rpmchecksig.c rpmds.c rpmfi.c rpmgi.c rpminstall.c rpmluaext.c rpmrollback.c rpmte.c rpmts.c rpmts.h tgi.c tpgp.c transaction.c rpm/perl RPM.xs RPM_Header.xs RPM_Spec.xs RPM_Transaction.xs rpmxs.c rpm/python header-py.c rpmdb-py.c rpmts-py.c spec-py.c rpm/rpmdb hdrfmt.c header.c librpmdb.vers pkgio.c rpmdb.c rpmtag.h signature.c rpm/rpmio iosm.c rpmtar.c rpm/tools rpm2cpio.c rpmcache.c rpmmtree.c rpmrepo.c Log: - jbj: finish up using rpmioFreePoolItem() for rpmts and Header objects. Summary: Revision Changes Path 1.2877 +1 -0 rpm/CHANGES 2.310 +12 -11 rpm/build/pack.c 2.198 +0 -1 rpm/build/spec.c 2.268 +2 -1 rpm/devtool.conf 1.436 +2 -2 rpm/lib/depends.c 2.184 +2 -5 rpm/lib/fsm.c 1.67 +0 -1 rpm/lib/librpm.vers 2.208 +4 -3 rpm/lib/package.c 2.352 +20 -15 rpm/lib/psm.c 1.229 +16 -9 rpm/lib/rpmchecksig.c 2.139 +2 -2 rpm/lib/rpmds.c 2.143 +10 -6 rpm/lib/rpmfi.c 2.65 +17 -13 rpm/lib/rpmgi.c 1.218 +2 -2 rpm/lib/rpminstall.c 2.8 +2 -5 rpm/lib/rpmluaext.c 1.42 +6 -4 rpm/lib/rpmrollback.c 2.99 +5 -7 rpm/lib/rpmte.c 2.166 +9 -12 rpm/lib/rpmts.c 2.115 +1 -3 rpm/lib/rpmts.h 2.23 +1 -4 rpm/lib/tgi.c 2.22 +1 -1 rpm/lib/tpgp.c 1.398 +8 -6 rpm/lib/transaction.c 1.31 +2 -1 rpm/perl/RPM.xs 1.25 +6 -3 rpm/perl/RPM_Header.xs 1.18 +6 -3 rpm/perl/RPM_Spec.xs 1.17 +6 -4 rpm/perl/RPM_Transaction.xs 1.12 +5 -5 rpm/perl/rpmxs.c 1.105 +11 -5 rpm/python/header-py.c 1.24 +2 -1 rpm/python/rpmdb-py.c 1.101 +9 -3 rpm/python/rpmts-py.c 1.13 +2 -2 rpm/python/spec-py.c 1.132 +2 -2 rpm/rpmdb/hdrfmt.c 1.177 +3 -18 rpm/rpmdb/header.c 1.61 +0 -1 rpm/rpmdb/librpmdb.vers 1.95 +6 -4 rpm/rpmdb/pkgio.c 1.285 +8 -5 rpm/rpmdb/rpmdb.c 1.59 +0 -2 rpm/rpmdb/rpmtag.h 1.61 +6 -5 rpm/rpmdb/signature.c 1.37 +2 -5 rpm/rpmio/iosm.c 1.27 +1 -4 rpm/rpmio/rpmtar.c 1.157 +2 -5 rpm/rpmqv.c 2.10 +1 -4 rpm/tools/rpm2cpio.c 2.37 +3 -6 rpm/tools/rpmcache.c 2.7 +5 -7 rpm/tools/rpmmtree.c 2.20 +5 -7 rpm/tools/rpmrepo.c ____________________________________________________________________________ patch -p0 <<'@@ .' Index: rpm/CHANGES ============================================================================ $ cvs diff -u -r1.2876 -r1.2877 CHANGES --- rpm/CHANGES 26 Mar 2009 14:51:20 -0000 1.2876 +++ rpm/CHANGES 26 Mar 2009 18:07:30 -0000 1.2877 @@ -1,5 +1,6 @@ 5.2a3 -> 5.2a4: + - 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 - jbj: rpmio: rescusitate splint annotations. @@ . patch -p0 <<'@@ .' Index: rpm/build/pack.c ============================================================================ $ cvs diff -u -r2.309 -r2.310 pack.c --- rpm/build/pack.c 26 Mar 2009 14:29:29 -0000 2.309 +++ rpm/build/pack.c 26 Mar 2009 18:07:31 -0000 2.310 @@ -28,10 +28,6 @@ #include "debug.h" -#define rpmtsfree() rpmioFreePoolItem() -#define headerFree() rpmioFreePoolItem() - - /*...@access rpmts @*/ /*...@access rpmfi @*/ /* compared with NULL */ /*...@access Header @*/ /* compared with NULL */ @@ -87,7 +83,7 @@ failedFile = _free(failedFile); (void)rpmtsFree(ts); - ts=NULL; + ts = NULL; return rc; } @@ -375,7 +371,8 @@ spec->packages = newPackage(spec); /* XXX the header just allocated will be allocated again */ - spec->packages->header = headerFree(spec->packages->header); + (void)headerFree(spec->packages->header); + spec->packages->header = NULL; /* Read the rpm lead, signatures, and header */ { rpmts ts = rpmtsCreate(); @@ -387,7 +384,7 @@ /*...@=mustmod@*/ (void)rpmtsFree(ts); - ts=NULL; + ts = NULL; if (sigs) *sigs = NULL; /* XXX HACK */ } @@ -641,7 +638,8 @@ /* Transfer header reference form *hdrp to h. */ h = headerLink(*hdrp); - *hdrp = headerFree(*hdrp); + (void)headerFree(*hdrp); + *hdrp = NULL; if (pkgidp) *pkgidp = NULL; @@ -919,7 +917,8 @@ msg = NULL; rc = rpmpkgWrite(item, fd, nh, &msg); - nh = headerFree(nh); + (void)headerFree(nh); + nh = NULL; if (rc != RPMRC_OK) { rpmlog(RPMLOG_ERR, "%s: %s: %s\n", fileName, item, (msg && *msg ? msg : "write failed\n")); @@ -950,7 +949,8 @@ exit: SHA1 = _free(SHA1); - h = headerFree(h); + (void)headerFree(h); + h = NULL; /* XXX Fish the pkgid out of the signature header. */ if (sigh != NULL && pkgidp != NULL) { @@ -960,7 +960,8 @@ *pkgidp = he->p.ui8p; /* XXX memory leak */ } - sigh = headerFree(sigh); + (void)headerFree(sigh); + sigh = NULL; if (ifd) { (void) Fclose(ifd); ifd = NULL; @@ . patch -p0 <<'@@ .' Index: rpm/build/spec.c ============================================================================ $ cvs diff -u -r2.197 -r2.198 spec.c --- rpm/build/spec.c 26 Mar 2009 14:29:29 -0000 2.197 +++ rpm/build/spec.c 26 Mar 2009 18:07:31 -0000 2.198 @@ -16,7 +16,6 @@ #include "rpmlua.h" #include "debug.h" -#define headerFree() rpmioFreePoolItem() /*...@-redecl@*/ extern int specedit; @@ . patch -p0 <<'@@ .' Index: rpm/devtool.conf ============================================================================ $ cvs diff -u -r2.267 -r2.268 devtool.conf --- rpm/devtool.conf 17 Mar 2009 22:51:37 -0000 2.267 +++ rpm/devtool.conf 26 Mar 2009 18:07:30 -0000 2.268 @@ -97,7 +97,8 @@ --enable-build-versionscript \ --enable-build-warnings \ --enable-build-debug \ - --enable-maintainer-mode + --enable-maintainer-mode \ + --disable-static # CC=ccache env UMASK=022 distcc cc # CFLAGS=-O2 -g -m32 -march=pentium-mmx -fasynchronous-unwind-tables -I/usr/include/python2.5 -I/usr/include/beecrypt @@ . patch -p0 <<'@@ .' Index: rpm/lib/depends.c ============================================================================ $ cvs diff -u -r1.435 -r1.436 depends.c --- rpm/lib/depends.c 26 Mar 2009 14:29:30 -0000 1.435 +++ rpm/lib/depends.c 26 Mar 2009 18:07:31 -0000 1.436 @@ -25,7 +25,6 @@ #include <rpmfi.h> #include "debug.h" -#define headerFree() rpmioFreePoolItem() /*...@access tsortInfo @*/ /*...@access rpmte @*/ /* XXX for install <-> erase associate. */ @@ -398,7 +397,8 @@ /*...@=nullptrarith@*/ } - debuginfoHeader = headerFree(debuginfoHeader); + (void)headerFree(debuginfoHeader); + debuginfoHeader = NULL; return (int)nrefs; } @@ . patch -p0 <<'@@ .' Index: rpm/lib/fsm.c ============================================================================ $ cvs diff -u -r2.183 -r2.184 fsm.c --- rpm/lib/fsm.c 26 Mar 2009 14:29:30 -0000 2.183 +++ rpm/lib/fsm.c 26 Mar 2009 18:07:31 -0000 2.184 @@ -34,9 +34,6 @@ #include "debug.h" -#define rpmtsfree() rpmioFreePoolItem() - - /*...@access FD_t @*/ /* XXX void ptr args */ /*...@access FSMI_t @*/ /*...@access IOSM_t @*/ @@ -141,7 +138,7 @@ iter->fi = rpmfiUnlink(iter->fi, "mapIterator"); /*...@-internalglobs@*/ /* XXX rpmswExit() */ (void)rpmtsFree(iter->ts); - iter->ts=NULL; + iter->ts = NULL; /*...@=internalglobs@*/ } return _free(p); @@ -752,7 +749,7 @@ fsm->lmtab = _free(fsm->lmtab); (void)rpmtsFree(fsm->iter->ts); - fsm->iter->ts=NULL; + fsm->iter->ts = NULL; fsm->iter = mapFreeIterator(fsm->iter); if (fsm->cfd != NULL) { /*...@-refcounttrans@*/ /* FIX: XfdFree annotation */ @@ . patch -p0 <<'@@ .' Index: rpm/lib/librpm.vers ============================================================================ $ cvs diff -u -r1.66 -r1.67 librpm.vers --- rpm/lib/librpm.vers 25 Mar 2009 13:38:42 -0000 1.66 +++ rpm/lib/librpm.vers 26 Mar 2009 18:07:31 -0000 1.67 @@ -340,7 +340,6 @@ rpmtsFilterFlags; rpmtsFindPubkey; rpmtsFlags; - rpmtsFree; rpmtsFreeLock; rpmtsGetKeyring; rpmtsGetTid; @@ . patch -p0 <<'@@ .' Index: rpm/lib/package.c ============================================================================ $ cvs diff -u -r2.207 -r2.208 package.c --- rpm/lib/package.c 26 Mar 2009 14:29:30 -0000 2.207 +++ rpm/lib/package.c 26 Mar 2009 18:07:31 -0000 2.208 @@ -17,7 +17,6 @@ #include "rpmts.h" #include "debug.h" -#define headerFree() rpmioFreePoolItem() #define alloca_strdup(_s) strcpy(alloca(strlen(_s)+1), (_s)) @@ -351,7 +350,8 @@ /* Bump reference count for return. */ *hdrp = headerLink(h); } - h = headerFree(h); + (void)headerFree(h); + h = NULL; /* Accumulate time reading package header. */ (void) rpmswAdd(rpmtsOp(ts, RPMTS_OP_READHDR), @@ -360,7 +360,8 @@ opsave); rpmtsCleanDig(ts); - sigh = headerFree(sigh); + (void)headerFree(sigh); + sigh = NULL; return rc; } /*...@=mods@*/ @@ . patch -p0 <<'@@ .' Index: rpm/lib/psm.c ============================================================================ $ cvs diff -u -r2.351 -r2.352 psm.c --- rpm/lib/psm.c 26 Mar 2009 14:29:30 -0000 2.351 +++ rpm/lib/psm.c 26 Mar 2009 18:07:31 -0000 2.352 @@ -43,10 +43,6 @@ #include "debug.h" -#define rpmtsfree() rpmioFreePoolItem() -#define headerFree() rpmioFreePoolItem() - - #define _PSM_DEBUG 0 /*...@unchecked@*/ int _psm_debug = _PSM_DEBUG; @@ -224,7 +220,8 @@ fi = rpmfiNew(ts, h, RPMTAG_BASENAMES, scareMem); fi->h = headerLink(h); - h = headerFree(h); + (void)headerFree(h); + h = NULL; if (fi == NULL) { /* XXX can't happen */ rpmrc = RPMRC_FAIL; @@ -377,7 +374,8 @@ psm->fi = rpmfiFree(psm->fi); psm->te = NULL; - if (h != NULL) h = headerFree(h); + if (h != NULL) (void)headerFree(h); + h = NULL; if (fi != NULL) { (void) rpmteSetHeader(fi->te, NULL); @@ -394,7 +392,7 @@ rpmtsClean(ts); (void)rpmtsFree(psm->ts); - psm->ts=NULL; + psm->ts = NULL; return rpmrc; } @@ -1554,7 +1552,7 @@ #endif /*...@-internalglobs@*/ (void)rpmtsFree(psm->ts); - psm->ts=NULL; + psm->ts = NULL; /*...@=internalglobs@*/ psm->sstates = _free(psm->sstates); @@ -2234,7 +2232,8 @@ } hi = headerFini(hi); - oh = headerFree(oh); + (void)headerFree(oh); + oh = NULL; uh = _free(uh); } else break; /* XXX shouldn't ever happen */ @@ -2277,7 +2276,8 @@ break; } rc = rpmpkgWrite(item, psm->fd, sigh, NULL); - sigh = headerFree(sigh); + (void)headerFree(sigh); + sigh = NULL; if (rc != RPMRC_OK) { break; } @@ -2602,16 +2602,21 @@ if (psm->goal == PSM_PKGERASE || psm->goal == PSM_PKGSAVE) { #ifdef DYING if (psm->te != NULL) -if (psm->te->h != NULL) -psm->te->h = headerFree(psm->te->h); +if (psm->te->h != NULL) { +(void)headerFree(psm->te->h); +psm->te->h = NULL; +} #else if (psm->te != NULL) (void) rpmteSetHeader(psm->te, NULL); #endif - if (fi->h != NULL) - fi->h = headerFree(fi->h); + if (fi->h != NULL) { + (void)headerFree(fi->h); + fi->h = NULL; + } } - psm->oh = headerFree(psm->oh); + (void)headerFree(psm->oh); + psm->oh = NULL; psm->pkgURL = _free(psm->pkgURL); psm->rpmio_flags = _free(psm->rpmio_flags); psm->payload_format = _free(psm->payload_format); @@ . patch -p0 <<'@@ .' Index: rpm/lib/rpmchecksig.c ============================================================================ $ cvs diff -u -r1.228 -r1.229 rpmchecksig.c --- rpm/lib/rpmchecksig.c 26 Mar 2009 14:29:30 -0000 1.228 +++ rpm/lib/rpmchecksig.c 26 Mar 2009 18:07:31 -0000 1.229 @@ -25,7 +25,6 @@ #include <rpmcli.h> #include "debug.h" -#define headerFree() rpmioFreePoolItem() /*...@access FD_t @*/ /* XXX stealing digests */ /*...@access Header @*/ /* XXX void * arg */ @@ -290,11 +289,14 @@ } } hi = headerFini(hi); - oh = headerFree(oh); + (void)headerFree(oh); + oh = NULL; - sigh = headerFree(sigh); + (void)headerFree(sigh); + sigh = NULL; sigh = headerLink(nh); - nh = headerFree(nh); + (void)headerFree(nh); + nh = NULL; } if (sigh != NULL) { @@ -457,7 +459,8 @@ if (ofd) (void) manageFile(&ofd, NULL, 0, res); lead = _free(lead); - sigh = headerFree(sigh); + (void)headerFree(sigh); + sigh = NULL; gi = rpmgiFree(gi); @@ -701,7 +704,8 @@ exit: /* Clean up. */ - h = headerFree(h); + (void)headerFree(h); + h = NULL; dig = pgpDigFree(dig, "rpmcliImportPubkey"); n = _free(n); u = _free(u); @@ -824,7 +828,8 @@ he->tag = RPMTAG_HEADERIMMUTABLE; xx = headerGet(h, he, 0); if (!xx || he->p.ptr == NULL) { - h = headerFree(h); + (void)headerFree(h); + h = NULL; rpmlog(RPMLOG_ERR, "%s: %s: %s\n", fn, _("headerGet failed"), _("failed to retrieve original header\n")); rc = RPMRC_FAIL; @@ -841,7 +846,8 @@ (void) rpmDigestUpdate(dig->hdrctx, he->p.ptr, he->c); he->p.ptr = _free(he->p.ptr); } - h = headerFree(h); + (void)headerFree(h); + h = NULL; } if (xar != NULL) { @@ -1126,7 +1132,8 @@ exit: rpmtsCleanDig(ts); - sigh = headerFree(sigh); + (void)headerFree(sigh); + sigh = NULL; return res; } @@ . patch -p0 <<'@@ .' Index: rpm/lib/rpmds.c ============================================================================ $ cvs diff -u -r2.138 -r2.139 rpmds.c --- rpm/lib/rpmds.c 26 Mar 2009 14:29:30 -0000 2.138 +++ rpm/lib/rpmds.c 26 Mar 2009 18:07:31 -0000 2.139 @@ -98,7 +98,6 @@ #include <rpmds.h> #include "debug.h" -#define headerFree() rpmioFreePoolItem() /*...@access rpmns @*/ /*...@access EVR_t @*/ @@ -165,7 +164,8 @@ ds->N = _free(ds->N); ds->EVR = _free(ds->EVR); ds->Flags = _free(ds->Flags); - ds->h = headerFree(ds->h); + (void)headerFree(ds->h); + ds->h = NULL; } ds->DNEVR = _free(ds->DNEVR); @@ . patch -p0 <<'@@ .' Index: rpm/lib/rpmfi.c ============================================================================ $ cvs diff -u -r2.142 -r2.143 rpmfi.c --- rpm/lib/rpmfi.c 26 Mar 2009 14:29:30 -0000 2.142 +++ rpm/lib/rpmfi.c 26 Mar 2009 18:07:31 -0000 2.143 @@ -33,7 +33,6 @@ #include <rpmcli.h> /* XXX rpmHeaderFormats */ #include "debug.h" -#define headerFree() rpmioFreePoolItem() /*...@access IOSM_t @*/ /* XXX cast */ @@ -1187,7 +1186,8 @@ int rpmfiSetHeader(rpmfi fi, Header h) { if (fi->h != NULL) - fi->h = headerFree(fi->h); + (void)headerFree(fi->h); + fi->h = NULL; if (h != NULL) fi->h = headerLink(h); return 0; @@ -1257,7 +1257,8 @@ fi->actions = _free(fi->actions); fi->replacedSizes = _free(fi->replacedSizes); - fi->h = headerFree(fi->h); + (void)headerFree(fi->h); + fi->h = NULL; } /*...@unchecked@*/ /*...@null@*/ @@ -1531,9 +1532,11 @@ /*...@-compdef@*/ /* FIX: fi->digests undefined */ foo = relocateFileList(ts, fi, h, (iosmFileAction *) fi->actions); /*...@=compdef@*/ - fi->h = headerFree(fi->h); + (void)headerFree(fi->h); + fi->h = NULL; fi->h = headerLink(foo); - foo = headerFree(foo); + (void)headerFree(foo); + foo = NULL; } if (fi->isSource && fi->dc == 1 && *fi->dnl[0] == '\0') { @@ -1586,7 +1589,8 @@ } if (!scareMem) - fi->h = headerFree(fi->h); + (void)headerFree(fi->h); + fi->h = NULL; fi->fn = NULL; fi->fnlen = 0; @@ . patch -p0 <<'@@ .' Index: rpm/lib/rpmgi.c ============================================================================ $ cvs diff -u -r2.64 -r2.65 rpmgi.c --- rpm/lib/rpmgi.c 26 Mar 2009 14:29:30 -0000 2.64 +++ rpm/lib/rpmgi.c 26 Mar 2009 18:07:31 -0000 2.65 @@ -25,10 +25,6 @@ #include "debug.h" -#define rpmtsfree() rpmioFreePoolItem() -#define headerFree() rpmioFreePoolItem() - - /*...@access FD_t @*/ /* XXX void * arg */ /*...@access fnpyKey @*/ /*...@access rpmdbMatchIterator @*/ @@ -150,7 +146,8 @@ /* XXX Read a package manifest. Restart ftswalk on success. */ case RPMRC_FAIL: default: - h = headerFree(h); + (void)headerFree(h); + h = NULL; break; case RPMRC_NOTTRUSTED: case RPMRC_NOKEY: @@ -230,7 +227,8 @@ if (rpmrc == RPMRC_OK && h != NULL) gi->h = headerLink(h); - h = headerFree(h); + (void)headerFree(h); + h = NULL; return rpmrc; } @@ -317,7 +315,8 @@ } if (h != NULL) { gi->h = headerLink(h); - h = headerFree(h); + (void)headerFree(h); + h = NULL; /*...@-noeffectuncon@*/ if (gi->stash != NULL) (void) (*gi->stash) (gi, gi->h); @@ -463,7 +462,8 @@ int xx; gi->hdrPath = _free(gi->hdrPath); - gi->h = headerFree(gi->h); + (void)headerFree(gi->h); + gi->h = NULL; gi->argv = argvFree(gi->argv); @@ -479,7 +479,7 @@ gi->tsi = rpmtsiFree(gi->tsi); gi->mi = rpmdbFreeIterator(gi->mi); (void)rpmtsFree(gi->ts); - gi->ts=NULL; + gi->ts = NULL; } /*...@unchecked@*/ /*...@null@*/ @@ -550,7 +550,8 @@ fprintf(stderr, "*** rpmgiNext(%p) tag %s\n", gi, tagName(gi->tag)); /* Free header from previous iteration. */ - gi->h = headerFree(gi->h); + (void)headerFree(gi->h); + gi->h = NULL; gi->hdrPath = _free(gi->hdrPath); hnum[0] = '\0'; @@ -635,7 +636,8 @@ sprintf(hnum, "%u", (unsigned)gi->i); gi->hdrPath = rpmExpand("%s h# ", teTypeString, hnum, NULL); rpmrc = RPMRC_OK; - h = headerFree(h); + (void)headerFree(h); + h = NULL; } } if (rpmrc != RPMRC_OK) { @@ -672,7 +674,8 @@ sprintf(hnum, "%u", (unsigned)gi->i); gi->hdrPath = rpmExpand("hdlist h# ", hnum, NULL); rpmrc = RPMRC_OK; - h = headerFree(h); + (void)headerFree(h); + h = NULL; } } if (rpmrc != RPMRC_OK) { @@ -796,7 +799,8 @@ } - gi->h = headerFree(gi->h); + (void)headerFree(gi->h); + gi->h = NULL; gi->hdrPath = _free(gi->hdrPath); gi->i = -1; gi->active = 0; @@ . patch -p0 <<'@@ .' Index: rpm/lib/rpminstall.c ============================================================================ $ cvs diff -u -r1.217 -r1.218 rpminstall.c --- rpm/lib/rpminstall.c 26 Mar 2009 14:29:30 -0000 1.217 +++ rpm/lib/rpminstall.c 26 Mar 2009 18:07:31 -0000 1.218 @@ -30,7 +30,6 @@ #include <rpmrollback.h> #include "debug.h" -#define headerFree() rpmioFreePoolItem() /*...@access FD_t @*/ /* XXX void * arg */ /*...@access rpmts @*/ /* XXX ts->suggests */ @@ -587,7 +586,8 @@ h = rpmgiReadHeader(gi, fn); if (h != NULL) gi->h = headerLink(h); - h = headerFree(h); + (void)headerFree(h); + h = NULL; } /* === Check for "-bang" erasures within install transaction. */ @@ . patch -p0 <<'@@ .' Index: rpm/lib/rpmluaext.c ============================================================================ $ cvs diff -u -r2.7 -r2.8 rpmluaext.c --- rpm/lib/rpmluaext.c 26 Mar 2009 14:29:30 -0000 2.7 +++ rpm/lib/rpmluaext.c 26 Mar 2009 18:07:31 -0000 2.8 @@ -32,9 +32,6 @@ #include "debug.h" -#define rpmtsfree() rpmioFreePoolItem() - - /* RPM Lua function: * <result> = rpm.vercmp( * <version1> -- first version (e.g. "N.N.N") @@ -178,7 +175,7 @@ /* destroy transaction */ (void)rpmtsFree(ts); - ts=NULL; + ts = NULL; /* provide results */ lua_pushboolean(L, rc == RPMRC_OK); @@ -269,7 +266,7 @@ /* destroy transaction */ (void)rpmtsFree(ts); - ts=NULL; + ts = NULL; return 1; } @@ . patch -p0 <<'@@ .' Index: rpm/lib/rpmrollback.c ============================================================================ $ cvs diff -u -r1.41 -r1.42 rpmrollback.c --- rpm/lib/rpmrollback.c 26 Mar 2009 14:29:30 -0000 1.41 +++ rpm/lib/rpmrollback.c 26 Mar 2009 18:07:31 -0000 1.42 @@ -28,7 +28,6 @@ #include <rpmrollback.h> #include "debug.h" -#define headerFree() rpmioFreePoolItem() /*...@access FD_t @*/ /* XXX void * arg */ /*...@access rpmts @*/ @@ -56,7 +55,8 @@ if (idtx->idt) for (i = 0; i < idtx->nidt; i++) { IDT idt = idtx->idt + i; - idt->h = headerFree(idt->h); + (void)headerFree(idt->h); + idt->h = NULL; idt->key = _free(idt->key); } idtx->idt = _free(idtx->idt); @@ -224,7 +224,8 @@ } idtx->nidt++; bottom: - h = headerFree(h); + (void)headerFree(h); + h = NULL; } for (i = 0; i < ac; i++) @@ -566,7 +567,8 @@ if (rc < 0) goto exit; #ifdef NOTYET - rp->h = headerFree(rp->h); + (void)headerFree(rp->h); + rpm->h = NULL; #endif rp->done = 1; } @@ . patch -p0 <<'@@ .' Index: rpm/lib/rpmte.c ============================================================================ $ cvs diff -u -r2.98 -r2.99 rpmte.c --- rpm/lib/rpmte.c 26 Mar 2009 14:29:30 -0000 2.98 +++ rpm/lib/rpmte.c 26 Mar 2009 18:07:31 -0000 2.99 @@ -19,10 +19,6 @@ #include "debug.h" -#define rpmtsfree() rpmioFreePoolItem() -#define headerFree() rpmioFreePoolItem() - - /*...@unchecked@*/ int _rpmte_debug = 0; @@ -79,7 +75,8 @@ p->blink.Pkgid = argvFree(p->blink.Pkgid); p->blink.Hdrid = argvFree(p->blink.Hdrid); - p->h = headerFree(p->h); + (void)headerFree(p->h); + p->h = NULL; /*...@-nullstate@*/ /* FIX: p->{NEVR,name} annotations */ return; @@ -285,7 +282,8 @@ Header rpmteSetHeader(rpmte te, Header h) { if (te != NULL) { - te->h = headerFree(te->h); + (void)headerFree(te->h); + te->h = NULL; if (h != NULL) te->h = headerLink(h); } @@ -723,7 +721,7 @@ rpmtsi tsi = _tsi; /*...@-internalglobs@*/ (void)rpmtsFree(tsi->ts); - tsi->ts=NULL; + tsi->ts = NULL; /*...@=internalglobs@*/ } @@ . patch -p0 <<'@@ .' Index: rpm/lib/rpmts.c ============================================================================ $ cvs diff -u -r2.165 -r2.166 rpmts.c --- rpm/lib/rpmts.c 26 Mar 2009 14:29:30 -0000 2.165 +++ rpm/lib/rpmts.c 26 Mar 2009 18:07:31 -0000 2.166 @@ -35,7 +35,6 @@ #include <rpmcli.h> #include "fs.h" -#define headerFree() rpmioFreePoolItem() /* XXX FIXME: merge with existing (broken?) tests in system.h */ /* portability fiddles */ @@ -370,7 +369,8 @@ continue; /* Save new "best" candidate. */ - bh = headerFree(bh); + (void)headerFree(bh); + bh = NULL; bh = headerLink(h); bhtime = htime; bhnamelen = hnamelen; @@ -386,7 +386,8 @@ if (qfmt == NULL || *qfmt == '\0') goto exit; str = headerSprintf(bh, qfmt, NULL, rpmHeaderFormats, &errstr); - bh = headerFree(bh); + (void)headerFree(bh); + bh = NULL; qfmt = _free(qfmt); if (str == NULL) { rpmlog(RPMLOG_ERR, _("incorrect solve path format: %s\n"), errstr); @@ -426,7 +427,8 @@ break; } str = _free(str); - h = headerFree(h); + (void)headerFree(h); + h = NULL; goto exit; } @@ -652,7 +654,7 @@ if (ts->scriptFd != NULL) { /*...@-refcounttrans@*/ /* FIX: XfdFree annotation */ - ts->scriptFd = fdFree(ts->scriptFd, "rpmtsFree"); + ts->scriptFd = fdFree(ts->scriptFd, __FUNCTION__); /*...@=refcounttrans@*/ ts->scriptFd = NULL; } @@ -682,12 +684,6 @@ } } -rpmts rpmtsFree(rpmts ts) -{ - (void) rpmioFreePoolItem((rpmioItem)ts, __FUNCTION__, __FILE__, __LINE__); - return NULL; -} - /*...@unchecked@*/ /*...@null@*/ rpmioPool _rpmtsPool; @@ -1205,7 +1201,8 @@ cbkey = NULL; } ptr = ts->notify(h, what, amount, total, cbkey, ts->notifyData); - h = headerFree(h); + (void)headerFree(h); + h = NULL; /*...@=noeffectuncon @*/ /*...@=type@*/ } @@ . patch -p0 <<'@@ .' Index: rpm/lib/rpmts.h ============================================================================ $ cvs diff -u -r2.114 -r2.115 rpmts.h --- rpm/lib/rpmts.h 24 Mar 2009 17:22:54 -0000 2.114 +++ rpm/lib/rpmts.h 26 Mar 2009 18:07:31 -0000 2.115 @@ -625,13 +625,11 @@ * @return NULL always */ /*...@null@*/ -rpmts rpmtsFree(/*...@killref@*/ /*...@only@*//*...@null@*/ rpmts ts) +rpmts rpmtsFree(/*...@killref@*/ /*...@null@*/ rpmts ts) /*...@globals fileSystem, internalState @*/ /*...@modifies ts, fileSystem, internalState @*/; -#ifdef NOTYET #define rpmtsFree(_ts) \ ((rpmts) rpmioFreePoolItem((rpmioItem)(_ts), __FUNCTION__, __FILE__, __LINE__)) -#endif /** \ingroup rpmts * Get transaction keyring. @@ . patch -p0 <<'@@ .' Index: rpm/lib/tgi.c ============================================================================ $ cvs diff -u -r2.22 -r2.23 tgi.c --- rpm/lib/tgi.c 26 Mar 2009 14:29:30 -0000 2.22 +++ rpm/lib/tgi.c 26 Mar 2009 18:07:31 -0000 2.23 @@ -19,9 +19,6 @@ #include "debug.h" -#define rpmtsfree() rpmioFreePoolItem() - - static const char * gitagstr = NULL; static const char * gikeystr = NULL; static rpmtransFlags transFlags = 0; @@ -286,7 +283,7 @@ gi = rpmgiFree(gi); (void)rpmtsFree(ts); - ts=NULL; + ts = NULL; optCon = rpmcliFini(optCon); return rc; @@ . patch -p0 <<'@@ .' Index: rpm/lib/tpgp.c ============================================================================ $ cvs diff -u -r2.21 -r2.22 tpgp.c --- rpm/lib/tpgp.c 26 Mar 2009 14:29:30 -0000 2.21 +++ rpm/lib/tpgp.c 26 Mar 2009 18:07:31 -0000 2.22 @@ -73,7 +73,7 @@ rc = doit(ts, "RSA"); (void)rpmtsFree(ts); - ts=NULL; + ts = NULL; optCon = rpmcliFini(optCon); @@ . patch -p0 <<'@@ .' Index: rpm/lib/transaction.c ============================================================================ $ cvs diff -u -r1.397 -r1.398 transaction.c --- rpm/lib/transaction.c 26 Mar 2009 14:29:30 -0000 1.397 +++ rpm/lib/transaction.c 26 Mar 2009 18:07:31 -0000 1.398 @@ -45,8 +45,6 @@ #include "debug.h" -#define headerFree() rpmioFreePoolItem() - /*...@access dbiIndexSet @*/ /*...@access fnpyKey @*/ @@ -1390,7 +1388,8 @@ p->fd = rpmtsNotify(ts, p, RPMCALLBACK_INST_CLOSE_FILE, 0, 0); /*...@=compdef =usereleased @*/ p->fd = NULL; - p->h = headerFree(p->h); + (void)headerFree(p->h); + p->h = NULL; } } pi = rpmtsiFree(pi); @@ -1893,8 +1892,10 @@ /* Would have freed header above in TR_ADD portion of switch * but needed the header to add it to the autorollback transaction. */ - if (rpmteType(p) == TR_ADDED) - p->h = headerFree(p->h); + if (rpmteType(p) == TR_ADDED) { + (void)headerFree(p->h); + p->h = NULL; + } xx = rpmdbSync(rpmtsGetRdb(ts)); @@ -1981,7 +1982,8 @@ /*...@=compdef =usereleased @*/ p->fd = NULL; p->fi = rpmfiFree(p->fi); - p->h = headerFree(p->h); + (void)headerFree(p->h); + p->h = NULL; } /*...@=nullpass@*/ } @@ . patch -p0 <<'@@ .' Index: rpm/perl/RPM.xs ============================================================================ $ cvs diff -u -r1.30 -r1.31 RPM.xs --- rpm/perl/RPM.xs 11 Oct 2008 00:41:46 -0000 1.30 +++ rpm/perl/RPM.xs 26 Mar 2009 18:07:32 -0000 1.31 @@ -220,5 +220,6 @@ PUTBACK; _installsrpms(ts, filename); SPAGAIN; - ts = rpmtsFree(ts); + (void)rpmtsFree(ts); + ts = NULL; @@ . patch -p0 <<'@@ .' Index: rpm/perl/RPM_Header.xs ============================================================================ $ cvs diff -u -r1.24 -r1.25 RPM_Header.xs --- rpm/perl/RPM_Header.xs 31 Jul 2008 00:21:41 -0000 1.24 +++ rpm/perl/RPM_Header.xs 26 Mar 2009 18:07:32 -0000 1.25 @@ -98,13 +98,15 @@ rpmtsSetVSFlags(ts, vsflags); _rpm2header(ts, filename, 0); SPAGAIN; - ts = rpmtsFree(ts); + (void)rpmtsFree(ts); + ts = NULL; void DESTROY(h) Header h CODE: - headerFree(h); + (void)headerFree(h); + h = NULL; # # OO methodes @@ -445,7 +447,8 @@ ts = rpmtsCreate(); RETVAL = rpmfiNew(ts, header, RPMTAG_BASENAMES, 0); if (RETVAL != NULL) RETVAL = rpmfiInit(RETVAL, 0); - ts = rpmtsFree(ts); + (void)rpmtsFree(ts); + ts = NULL; OUTPUT: RETVAL @@ . patch -p0 <<'@@ .' Index: rpm/perl/RPM_Spec.xs ============================================================================ $ cvs diff -u -r1.17 -r1.18 RPM_Spec.xs --- rpm/perl/RPM_Spec.xs 30 Nov 2008 21:39:25 -0000 1.17 +++ rpm/perl/RPM_Spec.xs 26 Mar 2009 18:07:32 -0000 1.18 @@ -75,7 +75,8 @@ PUTBACK; _newspec(ts, specfile, passphrase, rootdir, cookies, anyarch, force, verify); SPAGAIN; - ts = rpmtsFree(ts); + (void)rpmtsFree(ts); + ts = NULL; void DESTROY(spec) @@ -173,7 +174,8 @@ ps = rpmtsProblems(ts); if (ps && rpmpsNumProblems(ps)) /* if no problem, return undef */ XPUSHs(sv_2mortal(sv_setref_pv(newSVpv("", 0), "RPM::Problems", ps))); - ts = rpmtsFree(ts); + (void)rpmtsFree(ts); + ts = NULL; SPAGAIN; @@ -185,7 +187,8 @@ rpmts ts = rpmtsCreate(); CODE: RETVAL = _specbuild(ts, spec, sv_buildflags); - ts = rpmtsFree(ts); + (void)rpmtsFree(ts); + ts = NULL; OUTPUT: RETVAL @@ . patch -p0 <<'@@ .' Index: rpm/perl/RPM_Transaction.xs ============================================================================ $ cvs diff -u -r1.16 -r1.17 RPM_Transaction.xs --- rpm/perl/RPM_Transaction.xs 25 Dec 2008 17:47:32 -0000 1.16 +++ rpm/perl/RPM_Transaction.xs 26 Mar 2009 18:07:32 -0000 1.17 @@ -249,10 +249,11 @@ RETVAL void -DESTROY(t) - rpmts t +DESTROY(ts) + rpmts ts CODE: - t = rpmtsFree(t); + (void)rpmtsFree(ts); + ts = NULL; void setrootdir(ts, root) @@ -466,7 +467,8 @@ ps = rpmtsProblems(ts); RETVAL = rpmtsRun(ts, ps, probFilter); ps = rpmpsFree(ps); - ts = rpmtsFree(ts); + (void)rpmtsFree(ts); + ts = NULL; OUTPUT: RETVAL @@ . patch -p0 <<'@@ .' Index: rpm/perl/rpmxs.c ============================================================================ $ cvs diff -u -r1.11 -r1.12 rpmxs.c --- rpm/perl/rpmxs.c 26 Mar 2009 14:29:31 -0000 1.11 +++ rpm/perl/rpmxs.c 26 Mar 2009 18:07:32 -0000 1.12 @@ -23,7 +23,6 @@ #include "rpmconstant.h" #include "rpmxs.h" -#define headerFree() rpmioFreePoolItem() static int scalar2constant(SV * svconstant, const char * context, int * val) { int rc = 0; @@ -78,16 +77,17 @@ dSP; if ((fd = Fopen(filename, "r"))) { rc = rpmReadPackageFile(ts, fd, filename, &ret); - if (checkmode) { - XPUSHs(sv_2mortal(newSViv(rc))); - ret = headerFree(ret); /* For checking the package, we don't keep the header */ + if (checkmode) { + XPUSHs(sv_2mortal(newSViv(rc))); + (void)headerFree(ret); /* For checking the package, we don't keep the header */ + ret = NULL; } else { if (rc == 0) { XPUSHs(sv_2mortal(sv_setref_pv(newSVpv("", 0), "RPM::Header", (void *)ret))); } else { XPUSHs(sv_2mortal(&PL_sv_undef)); } - } + } Fclose(fd); } else { XPUSHs(sv_2mortal(&PL_sv_undef)); @@ . patch -p0 <<'@@ .' Index: rpm/python/header-py.c ============================================================================ $ cvs diff -u -r1.104 -r1.105 header-py.c --- rpm/python/header-py.c 26 Mar 2009 14:29:31 -0000 1.104 +++ rpm/python/header-py.c 26 Mar 2009 18:07:33 -0000 1.105 @@ -211,14 +211,16 @@ /* XXX this legacy switch is a hack, needs to be removed. */ if (legacy) { h = headerCopy(s->h); /* XXX strip region tags, etc */ - headerFree(s->h); + (void)headerFree(s->h); + s->h = NULL; } { size_t len; buf = headerUnload(h, &len); nb = len; nb -= 8; /* XXX HEADER_MAGIC_NO */ } - h = headerFree(h); + (void)headerFree(h); + h = NULL; if (buf == NULL || nb == 0) { PyErr_SetString(pyrpmError, "can't unload bad header\n"); @@ -336,6 +338,7 @@ /*...@*/ { if (s->h) headerFree(s->h); + s->h = NULL; PyObject_Del(s); } @@ -663,7 +666,8 @@ headerAllocated(h); hdr = hdr_Wrap(h); - h = headerFree(h); /* XXX ref held by hdr */ + (void)headerFree(h); /* XXX ref held by hdr */ + h = NULL; return (PyObject *) hdr; } @@ -705,7 +709,8 @@ } Py_DECREF(hdr); - h = headerFree(h); /* XXX ref held by hdr */ + (void)headerFree(h); /* XXX ref held by hdr */ + h = NULL; Py_BEGIN_ALLOW_THREADS { const char item[] = "Header"; @@ -818,7 +823,8 @@ if (h && tuple) { PyTuple_SET_ITEM(tuple, 0, (PyObject *) hdr_Wrap(h)); PyTuple_SET_ITEM(tuple, 1, PyLong_FromLong(offset)); - h = headerFree(h); + (void)headerFree(h); + h = NULL; } else { Py_INCREF(Py_None); Py_INCREF(Py_None); @@ . patch -p0 <<'@@ .' Index: rpm/python/rpmdb-py.c ============================================================================ $ cvs diff -u -r1.23 -r1.24 rpmdb-py.c --- rpm/python/rpmdb-py.c 26 Mar 2009 14:29:31 -0000 1.23 +++ rpm/python/rpmdb-py.c 26 Mar 2009 18:07:33 -0000 1.24 @@ -193,7 +193,8 @@ } ho = hdr_Wrap(h); - h = headerFree(h); + (void)headerFree(h); + h = NULL; return ho; } @@ . patch -p0 <<'@@ .' Index: rpm/python/rpmts-py.c ============================================================================ $ cvs diff -u -r1.100 -r1.101 rpmts-py.c --- rpm/python/rpmts-py.c 26 Mar 2009 14:29:31 -0000 1.100 +++ rpm/python/rpmts-py.c 26 Mar 2009 18:07:33 -0000 1.101 @@ -940,7 +940,8 @@ case RPMRC_OK: if (h) result = Py_BuildValue("N", hdr_Wrap(h)); - h = headerFree(h); /* XXX ref held by result */ + (void)headerFree(h); /* XXX ref held by result */ + h = NULL; break; case RPMRC_NOKEY: @@ -1523,8 +1524,8 @@ if (_rpmts_debug) fprintf(stderr, "%p -- ts %p db %p\n", s, s->ts, rpmtsGetRdb(s->ts)); - (void)rpmtsFree(s->ts); - s->ts=NULL; + (void)rpmtsFree(s->ts); + s->ts = NULL; if (s->scriptFd) Fclose(s->scriptFd); /* this will free the keyList, and decrement the ref count of all @@ -1603,8 +1604,13 @@ { if (_rpmts_debug) fprintf(stderr, "%p -- ts %p db %p\n", s, s->ts, rpmtsGetRdb(s->ts)); +<<<<<<< rpmts-py.c + (void)rpmtsFree(s->ts); + s->ts = NULL; +======= (void)rpmtsFree(s->ts); s->ts=NULL; +>>>>>>> 1.100 if (s->scriptFd) Fclose(s->scriptFd); @@ . patch -p0 <<'@@ .' Index: rpm/python/spec-py.c ============================================================================ $ cvs diff -u -r1.12 -r1.13 spec-py.c --- rpm/python/spec-py.c 3 Aug 2008 14:01:00 -0000 1.12 +++ rpm/python/spec-py.c 26 Mar 2009 18:07:33 -0000 1.13 @@ -25,8 +25,8 @@ * \code * import rpm * rpm.addMacro("_topdir","/path/to/topdir") - * ts=rpm.ts() - * s=ts.parseSpec("foo.spec") + * ts = rpm.ts() + * s = ts.parseSpec("foo.spec") * print s.prep() * \endcode * @@ . patch -p0 <<'@@ .' Index: rpm/rpmdb/hdrfmt.c ============================================================================ $ cvs diff -u -r1.131 -r1.132 hdrfmt.c --- rpm/rpmdb/hdrfmt.c 26 Mar 2009 14:29:32 -0000 1.131 +++ rpm/rpmdb/hdrfmt.c 26 Mar 2009 18:07:33 -0000 1.132 @@ -59,7 +59,6 @@ #include "misc.h" #include "debug.h" -#define headerFree() rpmioFreePoolItem() /*...@unchecked@*/ extern int _hdr_debug; @@ -6365,7 +6364,8 @@ if (errmsg) *errmsg = hsa->errmsg; /*...@=dependenttrans =observertrans @*/ - hsa->h = headerFree(hsa->h); + (void)headerFree(hsa->h); + hsa->h = NULL; hsa->fmt = _free(hsa->fmt); /*...@-retexpose@*/ return hsa->val; @@ . patch -p0 <<'@@ .' Index: rpm/rpmdb/header.c ============================================================================ $ cvs diff -u -r1.176 -r1.177 header.c --- rpm/rpmdb/header.c 26 Mar 2009 13:51:40 -0000 1.176 +++ rpm/rpmdb/header.c 26 Mar 2009 18:07:33 -0000 1.177 @@ -139,21 +139,6 @@ /*...@=nullstate@*/ } -#ifndef BUGGY -Header headerFree(Header h) -{ - /* XXX There's a h = headerFree(h) somewhere that depends on - * a NULL being returned from headerFree(). Wire up a NULL - * return from rpmioFreePoolItem() in headerFree() for now. - * Note: the code that depends on headerFree() returning NULL - * is on some lazy deallocation teardown path while trying to exit from - * rpm -qavv that is dereferencing a Header more often than necessary. - */ - (void) rpmioFreePoolItem((rpmioItem)h, __FUNCTION__, __FILE__, __LINE__); - return NULL; -} -#endif - /*...@unchecked@*/ /*...@null@*/ rpmioPool _headerPool; @@ -1325,7 +1310,7 @@ /*...@-onlytrans@*/ uh = headerUnload(h, NULL); - (void) headerFree(h); + (void)headerFree(h); h = NULL ; /*...@=onlytrans@*/ if (uh == NULL) @@ -2066,8 +2051,8 @@ HeaderIterator headerFini(/*...@only@*/ HeaderIterator hi) { if (hi != NULL) { - (void) headerFree(hi->h); - hi->h = NULL ; + (void)headerFree(hi->h); + hi->h = NULL; hi = _free(hi); } return hi; @@ . patch -p0 <<'@@ .' Index: rpm/rpmdb/librpmdb.vers ============================================================================ $ cvs diff -u -r1.60 -r1.61 librpmdb.vers --- rpm/rpmdb/librpmdb.vers 24 Mar 2009 19:30:22 -0000 1.60 +++ rpm/rpmdb/librpmdb.vers 26 Mar 2009 18:07:33 -0000 1.61 @@ -38,7 +38,6 @@ headerDefaultFormats; headerDel; headerFini; - headerFree; headerGet; headerGetBaseURL; headerSetBaseURL; @@ . patch -p0 <<'@@ .' Index: rpm/rpmdb/pkgio.c ============================================================================ $ cvs diff -u -r1.94 -r1.95 pkgio.c --- rpm/rpmdb/pkgio.c 26 Mar 2009 14:29:32 -0000 1.94 +++ rpm/rpmdb/pkgio.c 26 Mar 2009 18:07:33 -0000 1.95 @@ -32,7 +32,6 @@ #include "signature.h" #include "debug.h" -#define headerFree() rpmioFreePoolItem() /*...@access rpmts @*/ /*...@access pgpDig @*/ @@ -859,7 +858,8 @@ exit: if (sighp && sigh && rc == RPMRC_OK) *sighp = headerLink(sigh); - sigh = headerFree(sigh); + (void)headerFree(sigh); + sigh = NULL; if (msg != NULL) { buf[sizeof(buf)-1] = '\0'; @@ -1224,7 +1224,8 @@ h = headerLoad((void *)ptr); if (h == NULL) rc = RPMRC_FAIL; - h = headerFree(h); + (void)headerFree(h); + h = NULL; return rc; } @@ -1374,7 +1375,8 @@ *hdrp = headerLink(h); ei = _free(ei); dig = pgpDigFree(dig, "rpmReadHeader"); - h = headerFree(h); + (void)headerFree(h); + h = NULL; if (msg != NULL && *msg == NULL && buf[0] != '\0') { buf[sizeof(buf)-1] = '\0'; @@ . patch -p0 <<'@@ .' Index: rpm/rpmdb/rpmdb.c ============================================================================ $ cvs diff -u -r1.284 -r1.285 rpmdb.c --- rpm/rpmdb/rpmdb.c 26 Mar 2009 14:29:32 -0000 1.284 +++ rpm/rpmdb/rpmdb.c 26 Mar 2009 18:07:33 -0000 1.285 @@ -40,7 +40,6 @@ #include "legacy.h" #include "debug.h" -#define headerFree() rpmioFreePoolItem() #if defined(__LCLINT__) #define UINT32_T u_int32_t @@ -1563,7 +1562,8 @@ dirNames = _free(dirNames); /*...@=usereleased@*/ dirIndexes = _free(dirIndexes); - h = headerFree(h); + (void)headerFree(h); + h = NULL; } rec = _free(rec); @@ -1915,7 +1915,8 @@ v.size = 0; } - mi->mi_h = headerFree(mi->mi_h); + (void)headerFree(mi->mi_h); + mi->mi_h = NULL; /*...@-nullstate@*/ return rc; @@ -3110,7 +3111,8 @@ (void) unblockSignals(db, &signalMask); - h = headerFree(h); + (void)headerFree(h); + h = NULL; /* XXX return ret; */ return 0; @@ -4057,7 +4059,8 @@ { Header nh = (headerIsEntry(h, RPMTAG_HEADERIMAGE) ? headerCopy(h) : NULL); rc = rpmdbAdd(newdb, -1, (nh ? nh : h), ts); - nh = headerFree(nh); + (void)headerFree(nh); + nh = NULL; } if (rc) { @@ . patch -p0 <<'@@ .' Index: rpm/rpmdb/rpmtag.h ============================================================================ $ cvs diff -u -r1.58 -r1.59 rpmtag.h --- rpm/rpmdb/rpmtag.h 24 Mar 2009 15:17:13 -0000 1.58 +++ rpm/rpmdb/rpmtag.h 26 Mar 2009 18:07:33 -0000 1.59 @@ -833,10 +833,8 @@ /*...@null@*/ Header headerFree(/*...@killref@*/ /*...@null@*/ Header h) /*...@modifies h @*/; -#ifdef NOTYET /* XXX h = headerFree(h) NULL return needs to be found/fixed. */ #define headerFree(_h) \ ((Header)rpmioFreePoolItem((rpmioItem)(_h), __FUNCTION__, __FILE__, __LINE__)) -#endif /** \ingroup header * Create new (empty) header instance. @@ . patch -p0 <<'@@ .' Index: rpm/rpmdb/signature.c ============================================================================ $ cvs diff -u -r1.60 -r1.61 signature.c --- rpm/rpmdb/signature.c 26 Mar 2009 14:29:32 -0000 1.60 +++ rpm/rpmdb/signature.c 26 Mar 2009 18:07:33 -0000 1.61 @@ -20,8 +20,6 @@ #include "debug.h" -#define headerFree() rpmioFreePoolItem() - /*...@access f...@*/ /* XXX ufdio->read arg1 is void ptr */ /*...@access hea...@*/ /* XXX compared with NULL */ /*...@access digest_...@*/ /* XXX compared with NULL */ @@ -346,7 +344,8 @@ he->tag = RPMTAG_HEADERIMMUTABLE; if (!headerGet(h, he, 0) || he->p.ptr == NULL) { - h = headerFree(h); + (void)headerFree(h); + h = NULL; goto exit; } (void) headerGetMagic(NULL, &hmagic, &nmagic); @@ -357,7 +356,8 @@ (void) rpmDigestFinal(ctx, &SHA1, NULL, 1); he->p.ptr = _free(he->p.ptr); } - h = headerFree(h); + (void)headerFree(h); + h = NULL; if (SHA1 == NULL) goto exit; @@ -419,7 +419,8 @@ (void) Unlink(fn); fn = _free(fn); } - h = headerFree(h); + (void)headerFree(h); + h = NULL; if (fd != NULL) (void) Fclose(fd); return ret; } @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/iosm.c ============================================================================ $ cvs diff -u -r1.36 -r1.37 iosm.c --- rpm/rpmio/iosm.c 26 Mar 2009 14:29:32 -0000 1.36 +++ rpm/rpmio/iosm.c 26 Mar 2009 18:07:34 -0000 1.37 @@ -54,9 +54,6 @@ #include "debug.h" -#define rpmtsfree() rpmioFreePoolItem() - - /*...@access FD_t @*/ /* XXX void ptr args */ /*...@access IOSMI_t @*/ /*...@access IOSM_t @*/ @@ -807,8 +804,8 @@ #if defined(_USE_RPMTS) (void) rpmswAdd(rpmtsOp(iosmGetTs(iosm), RPMTS_OP_DIGEST), &iosm->op_digest); - iosm->(void)rpmtsFree(iter->ts); - iter->ts=NULL; + (void)rpmtsFree(iter->ts); + iter->ts = NULL; #else iosm->iter->ts = NULL; #endif @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/rpmtar.c ============================================================================ $ cvs diff -u -r1.26 -r1.27 rpmtar.c --- rpm/rpmio/rpmtar.c 26 Mar 2009 14:29:32 -0000 1.26 +++ rpm/rpmio/rpmtar.c 26 Mar 2009 18:07:34 -0000 1.27 @@ -120,9 +120,6 @@ #include "debug.h" -#define rpmtsfree() rpmioFreePoolItem() - - /*...@access FD_t @*/ /*...@access rpmpsm @*/ /*...@access IOSM_t @*/ @@ -579,7 +576,7 @@ psm = rpmpsmFree(psm); fi = rpmfiFree(fi); (void)rpmtsFree(ts); - ts=NULL; + ts = NULL; } return rc; @@ . patch -p0 <<'@@ .' Index: rpm/rpmqv.c ============================================================================ $ cvs diff -u -r1.156 -r1.157 rpmqv.c --- rpm/rpmqv.c 26 Mar 2009 14:29:29 -0000 1.156 +++ rpm/rpmqv.c 26 Mar 2009 18:07:30 -0000 1.157 @@ -56,9 +56,6 @@ #include "debug.h" -#define rpmtsfree() rpmioFreePoolItem() - - enum modes { MODE_QUERY = (1 << 0), @@ -360,7 +357,7 @@ rpmluaFree(lua); if (ts != NULL) (void)rpmtsFree(ts); - ts=NULL; + ts = NULL; if (spec_iob != NULL) spec_iob = rpmiobFree(spec_iob); if (proc_iob != NULL) @@ -1048,7 +1045,7 @@ #endif /* IAM_RPMBT || IAM_RPMK */ (void)rpmtsFree(ts); - ts=NULL; + ts = NULL; if (pipeChild) { (void) fclose(stdout); @@ . patch -p0 <<'@@ .' Index: rpm/tools/rpm2cpio.c ============================================================================ $ cvs diff -u -r2.9 -r2.10 rpm2cpio.c --- rpm/tools/rpm2cpio.c 26 Mar 2009 14:29:32 -0000 2.9 +++ rpm/tools/rpm2cpio.c 26 Mar 2009 18:07:34 -0000 2.10 @@ -14,9 +14,6 @@ #include "debug.h" -#define rpmtsfree() rpmioFreePoolItem() - - int main(int argc, char **argv) { FD_t fdi, fdo; @@ -59,7 +56,7 @@ /*...@=mustmod@*/ (void)rpmtsFree(ts); - ts=NULL; + ts = NULL; } switch (rc) { @@ . patch -p0 <<'@@ .' Index: rpm/tools/rpmcache.c ============================================================================ $ cvs diff -u -r2.36 -r2.37 rpmcache.c --- rpm/tools/rpmcache.c 26 Mar 2009 14:29:32 -0000 2.36 +++ rpm/tools/rpmcache.c 26 Mar 2009 18:07:34 -0000 2.37 @@ -28,10 +28,6 @@ #include "debug.h" -#define rpmtsfree() rpmioFreePoolItem() -#define headerFree() rpmioFreePoolItem() - - static int _debug = 0; /* XXX should be flag in ts */ @@ -68,7 +64,8 @@ if (item != NULL) { item->path = _free(item->path); item->this = rpmdsFree(item->this); - item->h = headerFree(item->h); + (void)headerFree(item->h); + item->h = NULL; item = _free(item); } return NULL; @@ -625,7 +622,7 @@ gi = rpmgiFree(gi); (void)rpmtsFree(ts); - ts=NULL; + ts = NULL; optCon = rpmcliFini(optCon); return ec; @@ . patch -p0 <<'@@ .' Index: rpm/tools/rpmmtree.c ============================================================================ $ cvs diff -u -r2.6 -r2.7 rpmmtree.c --- rpm/tools/rpmmtree.c 26 Mar 2009 14:29:32 -0000 2.6 +++ rpm/tools/rpmmtree.c 26 Mar 2009 18:07:34 -0000 2.7 @@ -103,10 +103,6 @@ #define _KFB(n) (1U << (n)) #define _MFB(n) (_KFB(n) | 0x40000000) -#define rpmtsfree() rpmioFreePoolItem() -#define headerFree() rpmioFreePoolItem() - - /** * Bit field enum for mtree CLI options. */ @@ -2978,7 +2974,8 @@ /* XXX Read a package manifest. Restart ftswalk on success. */ case RPMRC_FAIL: default: - h = headerFree(h); + (void)headerFree(h); + h = NULL; break; case RPMRC_NOTTRUSTED: case RPMRC_NOKEY: @@ -3003,7 +3000,8 @@ if (h != NULL) { fts->fi = rpmfiNew(fts->ts, h, RPMTAG_BASENAMES, 0); - h = headerFree(h); + (void)headerFree(h); + h = NULL; } return fts->fi; } @@ -3850,7 +3848,7 @@ exit: #if defined(_RPMFI_INTERNAL) (void)rpmtsFree(fts->ts); - fts->ts=NULL; + fts->ts = NULL; fts->fi = rpmfiFree(fts->fi); tagClean(NULL); /* Free header tag indices. */ #endif @@ . patch -p0 <<'@@ .' Index: rpm/tools/rpmrepo.c ============================================================================ $ cvs diff -u -r2.19 -r2.20 rpmrepo.c --- rpm/tools/rpmrepo.c 26 Mar 2009 14:29:32 -0000 2.19 +++ rpm/tools/rpmrepo.c 26 Mar 2009 18:07:34 -0000 2.20 @@ -56,10 +56,6 @@ #include "debug.h" -#define rpmtsfree() rpmioFreePoolItem() -#define headerFree() rpmioFreePoolItem() - - /*...@access FD_t @*/ /*...@access miRE @*/ @@ -1025,7 +1021,8 @@ case RPMRC_NOTFOUND: case RPMRC_FAIL: default: - h = headerFree(h); + (void)headerFree(h); + h = NULL; break; case RPMRC_NOTTRUSTED: case RPMRC_NOKEY: @@ -1255,7 +1252,8 @@ || repoWriteMDFile(repo, &repo->other, h)) rc = 1; - h = headerFree(h); + (void)headerFree(h); + h = NULL; if (rc) break; if (!repo->quiet) { @@ -2284,7 +2282,7 @@ exit: (void)rpmtsFree(repo->ts); - repo->ts=NULL; + repo->ts = NULL; repo->primary.digest = _free(repo->primary.digest); repo->primary.Zdigest = _free(repo->primary.Zdigest); repo->filelists.digest = _free(repo->filelists.digest); @@ . ______________________________________________________________________ RPM Package Manager http://rpm5.org CVS Sources Repository rpm-cvs@rpm5.org