From owner-svn-src-all@freebsd.org Tue Mar 7 05:35:15 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9C00D0167A; Tue, 7 Mar 2017 05:35:15 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 B64171B0E; Tue, 7 Mar 2017 05:35:15 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v275ZE1I072037; Tue, 7 Mar 2017 05:35:14 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v275ZEDC072036; Tue, 7 Mar 2017 05:35:14 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201703070535.v275ZEDC072036@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Tue, 7 Mar 2017 05:35:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314834 - in stable: 10/contrib/ipfilter/lib 11/contrib/ipfilter/lib X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Mar 2017 05:35:16 -0000 Author: cy Date: Tue Mar 7 05:35:14 2017 New Revision: 314834 URL: https://svnweb.freebsd.org/changeset/base/314834 Log: MFC r314627: Fix leak (free str before returning when ctx's calloc fails). Submitted by: trix_juniper.net (Tom Rix) Reviewed by: cy, ngie Discovered by: clang's static analyzer Differential Revision: D9877 Modified: stable/10/contrib/ipfilter/lib/save_v2trap.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/contrib/ipfilter/lib/save_v2trap.c Directory Properties: stable/11/ (props changed) Modified: stable/10/contrib/ipfilter/lib/save_v2trap.c ============================================================================== --- stable/10/contrib/ipfilter/lib/save_v2trap.c Tue Mar 7 05:10:38 2017 (r314833) +++ stable/10/contrib/ipfilter/lib/save_v2trap.c Tue Mar 7 05:35:14 2017 (r314834) @@ -124,8 +124,10 @@ snmpv2_parse(char **strings) str = strdup(*strings); ctx = calloc(1, sizeof(*ctx)); - if (ctx == NULL) + if (ctx == NULL) { + free(str); return NULL; + } ctx->fd = -1;