RPM Community Forums

Mailing List Message of <rpm-cvs>

[CVS] RPM: rpm/ CHANGES rpm/build/ pack.c rpm/lib/ poptALL.c rpmfi.c r...

From: Jeff Johnson <jbj@rpm5.org>
Date: Tue 27 Nov 2007 - 04:29:13 CET
Message-Id: <20071127032913.D92A4348465@rpm5.org>
  RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  ____________________________________________________________________________

  Server: rpm5.org                         Name:   Jeff Johnson
  Root:   /v/rpm/cvs                       Email:  jbj@rpm5.org
  Module: rpm                              Date:   27-Nov-2007 04:29:13
  Branch: HEAD                             Handle: 2007112703291201

  Modified files:
    rpm                     CHANGES
    rpm/build               pack.c
    rpm/lib                 poptALL.c rpmfi.c
    rpm/rpmdb               pkgio.c

  Log:
    - rpmbuild: more memory leak plugging.

  Summary:
    Revision    Changes     Path
    1.1894      +1  -0      rpm/CHANGES
    2.259       +4  -0      rpm/build/pack.c
    2.57        +2  -2      rpm/lib/poptALL.c
    2.107       +0  -5      rpm/lib/rpmfi.c
    1.63        +2  -1      rpm/rpmdb/pkgio.c
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/CHANGES
  ============================================================================
  $ cvs diff -u -r1.1893 -r1.1894 CHANGES
  --- rpm/CHANGES	27 Nov 2007 02:29:26 -0000	1.1893
  +++ rpm/CHANGES	27 Nov 2007 03:29:12 -0000	1.1894
  @@ -1,4 +1,5 @@
   5.0a2 -> 5.0a3:
  +    - jbj: rpmbuild: more memory leak plugging.
       - jbj: rpmbuild: plug some memory leaks.
       - jbj: fix: return 0, not -1, with unsigned changes as error.
       - jbj: add HEADERGET_NOEXTENSION disabler, kill off headerGetEntry.
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/build/pack.c
  ============================================================================
  $ cvs diff -u -r2.258 -r2.259 pack.c
  --- rpm/build/pack.c	27 Nov 2007 02:29:27 -0000	2.258
  +++ rpm/build/pack.c	27 Nov 2007 03:29:13 -0000	2.259
  @@ -736,6 +736,7 @@
   	    rc = RPMRC_FAIL;
   	    goto exit;
   	}
  +	msg = _free(msg);
   	(void) Fflush(fd);
       }
       fdFiniDigest(fd, PGPHASHALGO_SHA1, &SHA1, NULL, 1);
  @@ -846,6 +847,7 @@
   	    rc = RPMRC_FAIL;
   	    goto exit;
   	}
  +	msg = _free(msg);
       }
   
       /* Append the header and archive */
  @@ -870,6 +872,7 @@
   	    rc = RPMRC_FAIL;
   	    goto exit;
   	}
  +	msg = _free(msg);
   
   #ifdef	NOTYET
   	(void) headerMergeLegacySigs(nh, sigh);
  @@ -885,6 +888,7 @@
   	    rc = RPMRC_FAIL;
   	    goto exit;
   	}
  +	msg = _free(msg);
       }
   	
       /* Write the payload into the package. */
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/poptALL.c
  ============================================================================
  $ cvs diff -u -r2.56 -r2.57 poptALL.c
  --- rpm/lib/poptALL.c	24 Nov 2007 19:46:05 -0000	2.56
  +++ rpm/lib/poptALL.c	27 Nov 2007 03:29:13 -0000	2.57
  @@ -563,7 +563,6 @@
   poptContext
   rpmcliInit(int argc, char *const argv[], struct poptOption * optionsTable)
   {
  -    const char * optArg;
       poptContext optCon;
       char *path_buf, *path, *path_next;
       int rc;
  @@ -649,7 +648,8 @@
   
       /* Process all options, whine if unknown. */
       while ((rc = poptGetNextOpt(optCon)) > 0) {
  -	optArg = poptGetOptArg(optCon);
  +	const char * optArg = poptGetOptArg(optCon);
  +	optArg = _free(optArg);
   	switch (rc) {
   	default:
   /*@-nullpass@*/
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/rpmfi.c
  ============================================================================
  $ cvs diff -u -r2.106 -r2.107 rpmfi.c
  --- rpm/lib/rpmfi.c	26 Nov 2007 05:16:50 -0000	2.106
  +++ rpm/lib/rpmfi.c	27 Nov 2007 03:29:13 -0000	2.107
  @@ -1254,11 +1254,6 @@
       return 0;
   }
   
  -#define	_fdupe(_fi, _data)	\
  -    if ((_fi)->_data != NULL)	\
  -	(_fi)->_data = memcpy(xmalloc((_fi)->fc * sizeof(*(_fi)->_data)), \
  -			(_fi)->_data, (_fi)->fc * sizeof(*(_fi)->_data))
  -
   #define _fdupestring(_h, _tag, _data) \
       he->tag = _tag; \
       xx = headerGet((_h), he, 0); \
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmdb/pkgio.c
  ============================================================================
  $ cvs diff -u -r1.62 -r1.63 pkgio.c
  --- rpm/rpmdb/pkgio.c	26 Nov 2007 21:05:57 -0000	1.62
  +++ rpm/rpmdb/pkgio.c	27 Nov 2007 03:29:13 -0000	1.63
  @@ -1228,7 +1228,7 @@
           /*@modifies fd, *hdrp, *msg, fileSystem, internalState @*/
   {
   rpmxar xar = fdGetXAR(fd);
  -    pgpDig dig = fdGetDig(fd);
  +    pgpDig dig = pgpDigLink(fdGetDig(fd), "rpmReadHeader");
       char buf[BUFSIZ];
       uint32_t block[4];
       uint32_t il;
  @@ -1330,6 +1330,7 @@
       if (hdrp && h && rc == RPMRC_OK)
   	*hdrp = headerLink(h);
       ei = _free(ei);
  +    dig = pgpDigFree(dig);
       h = headerFree(h);
   
       if (msg != NULL && *msg == NULL && buf[0] != '\0') {
  @@ .
Received on Tue Nov 27 04:29:13 2007
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.