Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Mar 2018 22:49:06 +0000 (UTC)
From:      Conrad Meyer <cem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r331656 - head/cddl/contrib/opensolaris/tools/ctf/cvt
Message-ID:  <201803272249.w2RMn6ET025747@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cem
Date: Tue Mar 27 22:49:06 2018
New Revision: 331656
URL: https://svnweb.freebsd.org/changeset/base/331656

Log:
  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

Modified:
  head/cddl/contrib/opensolaris/tools/ctf/cvt/st_parse.c

Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/st_parse.c
==============================================================================
--- head/cddl/contrib/opensolaris/tools/ctf/cvt/st_parse.c	Tue Mar 27 21:37:58 2018	(r331655)
+++ head/cddl/contrib/opensolaris/tools/ctf/cvt/st_parse.c	Tue Mar 27 22:49:06 2018	(r331656)
@@ -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;



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