svn commit: r314153 - head/cddl/contrib/opensolaris/lib/libctf/common

Mark Johnston markj at FreeBSD.org
Thu Feb 23 17:54:18 UTC 2017


Author: markj
Date: Thu Feb 23 17:54:17 2017
New Revision: 314153
URL: https://svnweb.freebsd.org/changeset/base/314153

Log:
  Fix a memory leak in an error case in libctf.
  
  Submitted by:	Tom Rix <trix at juniper.net>
  MFC after:	1 week

Modified:
  head/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c

Modified: head/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c	Thu Feb 23 17:46:38 2017	(r314152)
+++ head/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c	Thu Feb 23 17:54:17 2017	(r314153)
@@ -346,6 +346,7 @@ ctf_fdopen(int fd, int *errp)
 			if ((sp32 = malloc(nbytes)) == NULL || pread64(fd,
 			    sp32, nbytes, hdr.e64.e_shoff) != nbytes) {
 				free(sp);
+				free(sp32);
 				return (ctf_set_open_errno(errp, errno));
 			}
 


More information about the svn-src-head mailing list