From owner-svn-src-head@FreeBSD.ORG Mon Apr 20 22:09:51 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C0DE7AED; Mon, 20 Apr 2015 22:09:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AFCC8AFD; Mon, 20 Apr 2015 22:09:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3KM9pNP094967; Mon, 20 Apr 2015 22:09:51 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3KM9pXl094966; Mon, 20 Apr 2015 22:09:51 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201504202209.t3KM9pXl094966@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 20 Apr 2015 22:09:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281798 - head/lib/libc/iconv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Apr 2015 22:09:51 -0000 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; }