Date: Mon, 14 Sep 2015 18:05:28 +0000 (UTC) From: Xin LI <delphij@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r287792 - stable/10/lib/libgeom Message-ID: <201509141805.t8EI5S6F096159@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: delphij Date: Mon Sep 14 18:05:27 2015 New Revision: 287792 URL: https://svnweb.freebsd.org/changeset/base/287792 Log: MFC r287247: Plug memory leaks when running out of memory. Reported by: clang scan-build Modified: stable/10/lib/libgeom/geom_xml2tree.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libgeom/geom_xml2tree.c ============================================================================== --- stable/10/lib/libgeom/geom_xml2tree.c Mon Sep 14 17:57:01 2015 (r287791) +++ stable/10/lib/libgeom/geom_xml2tree.c Mon Sep 14 18:05:27 2015 (r287792) @@ -275,15 +275,17 @@ EndElement(void *userData, const char *n XML_StopParser(mt->parser, 0); warn("Cannot allocate memory during processing of '%s' " "element", name); + free(p); return; } gc->lg_name = strdup(name); if (gc->lg_name == NULL) { - free(gc); mt->error = errno; XML_StopParser(mt->parser, 0); warn("Cannot allocate memory during processing of '%s' " "element", name); + free(gc); + free(p); return; } gc->lg_val = p;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201509141805.t8EI5S6F096159>