aboutsummaryrefslogtreecommitdiff
path: root/cddl/contrib
diff options
context:
space:
mode:
authorConrad Meyer <cem@FreeBSD.org>2018-03-27 22:49:06 +0000
committerConrad Meyer <cem@FreeBSD.org>2018-03-27 22:49:06 +0000
commit2f68cdb94454035989fa370bcb68db2f4e96b1ed (patch)
tree35159c31f1dc5f70dfa31e30f1868e70c97396cb /cddl/contrib
parentc8168d9b4c042389200263e18a0891c19d46f811 (diff)
downloadsrc-2f68cdb94454035989fa370bcb68db2f4e96b1ed.tar.gz
src-2f68cdb94454035989fa370bcb68db2f4e96b1ed.zip
ctfconvert: Fix minor memory leaks in STABS parser
In an error case, free leaked objects. Does anything use STABS anymore? Probably not. Reported by: Coverity Sponsored by: Dell EMC Isilon
Notes
Notes: svn path=/head/; revision=331656
Diffstat (limited to 'cddl/contrib')
-rw-r--r--cddl/contrib/opensolaris/tools/ctf/cvt/st_parse.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/cddl/contrib/opensolaris/tools/ctf/cvt/st_parse.c b/cddl/contrib/opensolaris/tools/ctf/cvt/st_parse.c
index 21a0149861be..a452ca5960a7 100644
--- a/cddl/contrib/opensolaris/tools/ctf/cvt/st_parse.c
+++ b/cddl/contrib/opensolaris/tools/ctf/cvt/st_parse.c
@@ -229,8 +229,12 @@ parse_fun(char *cp, iidesc_t *ii)
nargs++;
if (nargs > FUNCARG_DEF)
args = xrealloc(args, sizeof (tdesc_t *) * nargs);
- if (!(cp = read_tid(cp, &args[nargs - 1])))
+ if (!(cp = read_tid(cp, &args[nargs - 1]))) {
+ if (tdp->t_type == TYPEDEF_UNRES)
+ free(tdp);
+ free(args);
return (-1);
+ }
}
ii->ii_type = iitype;