Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 26 Jan 2014 07:20:32 +0000 (UTC)
From:      Kevin Lo <kevlo@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r261181 - head/bin/pax
Message-ID:  <201401260720.s0Q7KWvT002835@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kevlo
Date: Sun Jan 26 07:20:32 2014
New Revision: 261181
URL: http://svnweb.freebsd.org/changeset/base/261181

Log:
  Stop the options string leak if it is not attached into the options
  linked list.
  
  Obtained from:	OpenBSD

Modified:
  head/bin/pax/options.c

Modified: head/bin/pax/options.c
==============================================================================
--- head/bin/pax/options.c	Sun Jan 26 04:57:58 2014	(r261180)
+++ head/bin/pax/options.c	Sun Jan 26 07:20:32 2014	(r261181)
@@ -1385,6 +1385,7 @@ opt_add(const char *str)
 			free(lstr);
 			return(-1);
 		}
+		lstr = NULL;	/* parts of string going onto the OPLIST */
 		*pt++ = '\0';
 		opt->name = frpt;
 		opt->value = pt;
@@ -1400,6 +1401,7 @@ opt_add(const char *str)
 		optail->fow = opt;
 		optail = opt;
 	}
+	free(lstr);
 	return(0);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201401260720.s0Q7KWvT002835>