From owner-p4-projects@FreeBSD.ORG Thu Jul 13 17:50:29 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 10EF116A4E1; Thu, 13 Jul 2006 17:50:29 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C8D1C16A4DD for ; Thu, 13 Jul 2006 17:50:28 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9427B43D49 for ; Thu, 13 Jul 2006 17:50:28 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k6DHoSCC056572 for ; Thu, 13 Jul 2006 17:50:28 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k6DHoS5x056569 for perforce@freebsd.org; Thu, 13 Jul 2006 17:50:28 GMT (envelope-from jhb@freebsd.org) Date: Thu, 13 Jul 2006 17:50:28 GMT Message-Id: <200607131750.k6DHoS5x056569@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Cc: Subject: PERFORCE change 101482 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2006 17:50:29 -0000 http://perforce.freebsd.org/chv.cgi?CH=101482 Change 101482 by jhb@jhb_mutex on 2006/07/13 17:50:17 Don't free sa in kern_bind() as this breaks the svr4 case. Make the caller responsible for managing the sockaddr lifetime. Affected files ... .. //depot/projects/smpng/sys/compat/linux/linux_socket.c#33 edit .. //depot/projects/smpng/sys/kern/uipc_syscalls.c#88 edit Differences ... ==== //depot/projects/smpng/sys/compat/linux/linux_socket.c#33 (text+ko) ==== @@ -609,7 +609,9 @@ if (error) return (error); - return (kern_bind(td, linux_args.s, sa)); + error = kern_bind(td, linux_args.s, sa); + free(sa, M_SONAME); + return (error); } struct linux_connect_args { ==== //depot/projects/smpng/sys/kern/uipc_syscalls.c#88 (text+ko) ==== @@ -209,7 +209,9 @@ if ((error = getsockaddr(&sa, uap->name, uap->namelen)) != 0) return (error); - return (kern_bind(td, uap->s, sa)); + error = kern_bind(td, uap->s, sa); + free(sa, M_SONAME); + return (error); } int @@ -241,7 +243,6 @@ fdrop(fp, td); done2: NET_UNLOCK_GIANT(); - FREE(sa, M_SONAME); return (error); }