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

This commit is contained in:
Mark Johnston 2014-12-23 15:40:57 +00:00
parent cafe874475
commit 3f1cbdbeb1
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=276143

View File

@ -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;