PERFORCE change 101482 for review

John Baldwin jhb at FreeBSD.org
Thu Jul 13 17:50:29 UTC 2006


http://perforce.freebsd.org/chv.cgi?CH=101482

Change 101482 by jhb at 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);
 }
 


More information about the p4-projects mailing list