Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Apr 2015 22:09:51 +0000 (UTC)
From:      "Pedro F. Giffuni" <pfg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r281798 - head/lib/libc/iconv
Message-ID:  <201504202209.t3KM9pXl094966@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pfg
Date: Mon Apr 20 22:09:50 2015
New Revision: 281798
URL: https://svnweb.freebsd.org/changeset/base/281798

Log:
  Fix improbable memory leak in _citrus_prop_read_str().
  
  Found by:	Clang Static Analyzer

Modified:
  head/lib/libc/iconv/citrus_prop.c

Modified: head/lib/libc/iconv/citrus_prop.c
==============================================================================
--- head/lib/libc/iconv/citrus_prop.c	Mon Apr 20 22:08:11 2015	(r281797)
+++ head/lib/libc/iconv/citrus_prop.c	Mon Apr 20 22:09:50 2015	(r281798)
@@ -293,8 +293,10 @@ done:
 		}
 		_memstream_ungetc(ms, ch);
 		errnum = _citrus_prop_read_character_common(ms, &ch);
-		if (errnum != 0)
+		if (errnum != 0) {
+			free(s);
 			return (errnum);
+		}
 		s[n] = ch;
 		++n, --m;
 	}



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