From owner-svn-src-all@freebsd.org Tue Jun 6 21:51:05 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 DF036BF587D; Tue, 6 Jun 2017 21:51:05 +0000 (UTC) (envelope-from stevek@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 AFA9B7C731; Tue, 6 Jun 2017 21:51:05 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v56Lp4Ol020803; Tue, 6 Jun 2017 21:51:04 GMT (envelope-from stevek@FreeBSD.org) Received: (from stevek@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v56Lp4qP020802; Tue, 6 Jun 2017 21:51:04 GMT (envelope-from stevek@FreeBSD.org) Message-Id: <201706062151.v56Lp4qP020802@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: stevek set sender to stevek@FreeBSD.org using -f From: "Stephen J. Kiernan" Date: Tue, 6 Jun 2017 21:51:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319638 - head/usr.sbin/ppp X-SVN-Group: head 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, 06 Jun 2017 21:51:06 -0000 Author: stevek Date: Tue Jun 6 21:51:04 2017 New Revision: 319638 URL: https://svnweb.freebsd.org/changeset/base/319638 Log: Before returning because of an memory allocation error, free the memory already allocated to buf. Found using clang's static analyzer - scan-build Submitted by: Thomas Rix Reviewed by: stevek Approved by: sjg (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D9852 Modified: head/usr.sbin/ppp/iface.c Modified: head/usr.sbin/ppp/iface.c ============================================================================== --- head/usr.sbin/ppp/iface.c Tue Jun 6 21:50:00 2017 (r319637) +++ head/usr.sbin/ppp/iface.c Tue Jun 6 21:51:04 2017 (r319638) @@ -145,6 +145,7 @@ iface_Create(const char *name) iface = (struct iface *)malloc(sizeof *iface); if (iface == NULL) { fprintf(stderr, "iface_Create: malloc: %s\n", strerror(errno)); + free(buf); return NULL; } iface->name = strdup(name);