From owner-svn-src-all@FreeBSD.ORG Sun Sep 23 08:38:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 522AA106566C; Sun, 23 Sep 2012 08:38:07 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 238978FC12; Sun, 23 Sep 2012 08:38:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8N8c6J8056085; Sun, 23 Sep 2012 08:38:06 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8N8c6Tu056083; Sun, 23 Sep 2012 08:38:06 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201209230838.q8N8c6Tu056083@svn.freebsd.org> From: Kevin Lo Date: Sun, 23 Sep 2012 08:38:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240850 - head/lib/libstand X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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: Sun, 23 Sep 2012 08:38:07 -0000 Author: kevlo Date: Sun Sep 23 08:38:06 2012 New Revision: 240850 URL: http://svn.freebsd.org/changeset/base/240850 Log: Avoid NULL dereference Modified: head/lib/libstand/nfs.c Modified: head/lib/libstand/nfs.c ============================================================================== --- head/lib/libstand/nfs.c Sun Sep 23 07:43:10 2012 (r240849) +++ head/lib/libstand/nfs.c Sun Sep 23 08:38:06 2012 (r240850) @@ -1256,8 +1256,10 @@ nfs_open(const char *upath, struct open_ error = 0; out: - free(newfd); - free(path); + if (newfd) + free(newfd); + if (path) + free(path); #else currfd->iodesc = desc;