RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  ____________________________________________________________________________

  Server: rpm5.org                         Name:   Jeff Johnson
  Root:   /v/rpm/cvs                       Email:  [EMAIL PROTECTED]
  Module: rpm                              Date:   20-Jul-2007 02:57:43
  Branch: HEAD                             Handle: 2007072001574201

  Modified files:
    rpm                     CHANGES
    rpm/lib                 formats.c

  Log:
    - fix a --import memory leak.

  Summary:
    Revision    Changes     Path
    1.1499      +1  -0      rpm/CHANGES
    2.101       +7  -1      rpm/lib/formats.c
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/CHANGES
  ============================================================================
  $ cvs diff -u -r1.1498 -r1.1499 CHANGES
  --- rpm/CHANGES       19 Jul 2007 19:07:56 -0000      1.1498
  +++ rpm/CHANGES       20 Jul 2007 00:57:42 -0000      1.1499
  @@ -1,4 +1,5 @@
   4.5 -> 5.0:
  +    - jbj: fix a --import memory leak.
       - rse: unbreak big-endian handling in memory and cryptography functions 
by Autoconf providing WORDS_BIGENDIAN and fixing usage
       - rse: cleanup and fix the code to compile under *non*-GCC compilers 
(e.g. Sun Studio and Intel C/C++)
       - rse: fix building under --with-dmalloc with DMalloc 5.5.2 where 
"x{malloc,calloc,realloc,free}" are also overridden
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/formats.c
  ============================================================================
  $ cvs diff -u -r2.100 -r2.101 formats.c
  --- rpm/lib/formats.c 18 Jun 2007 17:31:23 -0000      2.100
  +++ rpm/lib/formats.c 20 Jul 2007 00:57:43 -0000      2.101
  @@ -161,6 +161,7 @@
       const unsigned char * s;
       size_t ns;
       int atype;
  +    char * val;
   
       switch (type) {
       case RPM_OPENPGP_TYPE:
  @@ -174,6 +175,8 @@
       case RPM_STRING_TYPE:
       case RPM_STRING_ARRAY_TYPE:
        enc = data;
  +     s = NULL;
  +     ns = 0;
        if (b64decode(enc, (void **)&s, &ns))
            return xstrdup(_("(not base64)"));
        atype = PGPARMOR_PUBKEY;        /* XXX check pkt for pubkey */
  @@ -191,7 +194,10 @@
       }
   
       /* XXX this doesn't use padding directly, assumes enough slop in retval. 
*/
  -    return pgpArmorWrap(atype, s, ns);
  +    val = pgpArmorWrap(atype, s, ns);
  +    if (atype == PGPARMOR_PUBKEY)
  +     s = _free(s);
  +    return val;
   }
   
   /**
  @@ .
______________________________________________________________________
RPM Package Manager                                    http://rpm5.org
CVS Sources Repository                                rpm-cvs@rpm5.org

Reply via email to