From 2f68cdb94454035989fa370bcb68db2f4e96b1ed Mon Sep 17 00:00:00 2001 From: Conrad Meyer Date: Tue, 27 Mar 2018 22:49:06 +0000 Subject: [PATCH] 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 --- cddl/contrib/opensolaris/tools/ctf/cvt/st_parse.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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;