RPM Community Forums

Mailing List Message of <rpm-cvs>

[CVS] RPM: xar/src/ xar.c

From: Anders F. Björklund <afb@rpm5.org>
Date: Sat 15 Sep 2007 - 09:17:44 CEST
Message-Id: <20070915071744.2B66B34845C@rpm5.org>
  RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  ____________________________________________________________________________

  Server: rpm5.org                         Name:   Anders F. Björklund
  Root:   /v/rpm/cvs                       Email:  afb@rpm5.org
  Module: xar                              Date:   15-Sep-2007 09:17:44
  Branch: HEAD                             Handle: 2007091508174400

  Modified files:
    xar/src                 xar.c

  Log:
    strdup literals to avoid bad free

  Summary:
    Revision    Changes     Path
    1.5         +2  -2      xar/src/xar.c
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: xar/src/xar.c
  ============================================================================
  $ cvs diff -u -r1.4 -r1.5 xar.c
  --- xar/src/xar.c	15 Sep 2007 07:16:34 -0000	1.4
  +++ xar/src/xar.c	15 Sep 2007 07:17:44 -0000	1.5
  @@ -108,11 +108,11 @@
   	mode_t m;
   	xar_prop_get(f, "mode", &mode);
   	if( mode == NULL )
  -		return "??????????";
  +		return strdup("??????????");
   	errno = 0;
   	m = strtoll(mode, 0, 8);
   	if( errno )
  -		return "??????????";
  +		return strdup("??????????");
   
   	ret = calloc(11,1);
   	memset(ret, '-', 10);
  @@ .
Received on Sat Sep 15 09:17:44 2007
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.