diff options
author | markj <markj@FreeBSD.org> | 2014-12-23 15:40:57 +0000 |
---|---|---|
committer | markj <markj@FreeBSD.org> | 2014-12-23 15:40:57 +0000 |
commit | 13e5279a0191fc19efada5b6e99f61d50949d4a1 (patch) | |
tree | 369b491a6e060c02c31e022407d0304ee1f85c39 /lib/libproc/proc_sym.c | |
parent | 7ea63e4fb49b9fd6e09141a3b07ab5137e249a08 (diff) | |
download | FreeBSD-src-13e5279a0191fc19efada5b6e99f61d50949d4a1.zip FreeBSD-src-13e5279a0191fc19efada5b6e99f61d50949d4a1.tar.gz |
Fix a memory leak that occured when looking up CTF info for a symbol.
Diffstat (limited to 'lib/libproc/proc_sym.c')
-rw-r--r-- | lib/libproc/proc_sym.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/libproc/proc_sym.c b/lib/libproc/proc_sym.c index 766ff73..e52f8ff 100644 --- a/lib/libproc/proc_sym.c +++ b/lib/libproc/proc_sym.c @@ -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; |