Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Feb 2014 21:36:05 +0000 (UTC)
From:      Mateusz Guzik <mjg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r262259 - stable/10/sys/kern
Message-ID:  <201402202136.s1KLa5wH066523@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mjg
Date: Thu Feb 20 21:36:05 2014
New Revision: 262259
URL: http://svnweb.freebsd.org/changeset/base/262259

Log:
  MFC r260233:
  
  Plug a memory leak in dup2 when both old and new fd have ioctl caps.

Modified:
  stable/10/sys/kern/kern_descrip.c

Modified: stable/10/sys/kern/kern_descrip.c
==============================================================================
--- stable/10/sys/kern/kern_descrip.c	Thu Feb 20 21:32:24 2014	(r262258)
+++ stable/10/sys/kern/kern_descrip.c	Thu Feb 20 21:36:05 2014	(r262259)
@@ -879,6 +879,7 @@ do_dup(struct thread *td, int flags, int
 	/*
 	 * Duplicate the source descriptor.
 	 */
+	filecaps_free(&newfde->fde_caps);
 	*newfde = *oldfde;
 	filecaps_copy(&oldfde->fde_caps, &newfde->fde_caps);
 	if ((flags & DUP_CLOEXEC) != 0)



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