Date: Thu, 13 Jul 2006 17:50:28 GMT From: John Baldwin <jhb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 101482 for review Message-ID: <200607131750.k6DHoS5x056569@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200607131750.k6DHoS5x056569>