Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Dec 2014 15:40:58 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r276143 - head/lib/libproc
Message-ID:  <201412231540.sBNFewc1092572@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markj
Date: Tue Dec 23 15:40:57 2014
New Revision: 276143
URL: https://svnweb.freebsd.org/changeset/base/276143

Log:
  Fix a memory leak that occured when looking up CTF info for a symbol.

Modified:
  head/lib/libproc/proc_sym.c

Modified: head/lib/libproc/proc_sym.c
==============================================================================
--- head/lib/libproc/proc_sym.c	Tue Dec 23 15:38:19 2014	(r276142)
+++ head/lib/libproc/proc_sym.c	Tue Dec 23 15:40:57 2014	(r276143)
@@ -501,13 +501,16 @@ ctf_file_t *
 proc_name2ctf(struct proc_handle *p, const char *name)
 {
 #ifndef NO_CTF
+	ctf_file_t *ctf;
 	prmap_t *map;
 	int error;
 
 	if ((map = proc_name2map(p, name)) == NULL)
 		return (NULL);
 
-	return (ctf_open(map->pr_mapname, &error));
+	ctf = ctf_open(map->pr_mapname, &error);
+	free(map);
+	return (ctf);
 #else
 	(void)p;
 	(void)name;



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