RPM Community Forums

Mailing List Message of <rpm-cvs>

[CVS] RPM: rpm/build/ files.c

From: Jeff Johnson <jbj@rpm5.org>
Date: Sun 22 Jul 2007 - 07:39:16 CEST
Message-Id: <20070722053916.A2A5C3484F4@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:   22-Jul-2007 07:39:16
  Branch: HEAD                             Handle: 2007072206391600

  Modified files:
    rpm/build               files.c

  Log:
    plug more memory leaks.

  Summary:
    Revision    Changes     Path
    1.258       +10 -5      rpm/build/files.c
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/build/files.c
  ============================================================================
  $ cvs diff -u -r1.257 -r1.258 files.c
  --- rpm/build/files.c	22 Jul 2007 05:28:58 -0000	1.257
  +++ rpm/build/files.c	22 Jul 2007 05:39:16 -0000	1.258
  @@ -1691,6 +1691,7 @@
       const char *fileUname;
       const char *fileGname;
       char *lang;
  +    int rc = 0;
       
       /* Path may have prepended buildRootURL, so locate the original filename. */
       /*
  @@ -1745,7 +1746,8 @@
   	    rpmError(RPMERR_BADSPEC, _("File doesn't match prefix (%s): %s\n"),
   		     fl->prefix, fileURL);
   	    fl->processingFailed = 1;
  -	    return RPMERR_BADSPEC;
  +	    rc = RPMERR_BADSPEC;
  +	    goto exit;
   	}
       }
   
  @@ -1768,13 +1770,15 @@
   	} else if (Lstat(diskURL, statp)) {
   	    rpmError(RPMERR_BADSPEC, _("File not found: %s\n"), diskURL);
   	    fl->processingFailed = 1;
  -	    return RPMERR_BADSPEC;
  +	    rc = RPMERR_BADSPEC;
  +	    goto exit;
   	}
       }
   
       if ((! fl->isDir) && S_ISDIR(statp->st_mode)) {
   /*@-nullstate@*/ /* FIX: fl->buildRootURL may be NULL */
  -	return recurseDir(fl, diskURL);
  +	rc = recurseDir(fl, diskURL);
  +	goto exit;
   /*@=nullstate@*/
       }
   
  @@ -1883,9 +1887,10 @@
   
       fl->fileListRecsUsed++;
       fl->fileCount++;
  -/*@i@*/ fn = _free(fn);
   
  -    return 0;
  +exit:
  +/*@i@*/ fn = _free(fn);
  +    return rc;
   }
   /*@=boundswrite@*/
   
  @@ .
Received on Sun Jul 22 07:39:16 2007
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.