summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/compat/linux/linux_socket.c5
-rw-r--r--sys/kern/uipc_syscalls.c10
2 files changed, 10 insertions, 5 deletions
diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c
index 8b164fa..3f089c0 100644
--- a/sys/compat/linux/linux_socket.c
+++ b/sys/compat/linux/linux_socket.c
@@ -609,7 +609,9 @@ linux_bind(struct thread *td, struct linux_bind_args *args)
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 {
@@ -638,6 +640,7 @@ linux_connect(struct thread *td, struct linux_connect_args *args)
return (error);
error = kern_connect(td, linux_args.s, sa);
+ free(sa, M_SONAME);
if (error != EISCONN)
return (error);
diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c
index 76a66a4..a9eaa0d 100644
--- a/sys/kern/uipc_syscalls.c
+++ b/sys/kern/uipc_syscalls.c
@@ -209,7 +209,9 @@ bind(td, uap)
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 @@ done1:
fdrop(fp, td);
done2:
NET_UNLOCK_GIANT();
- FREE(sa, M_SONAME);
return (error);
}
@@ -534,7 +535,9 @@ connect(td, uap)
if (error)
return (error);
- return (kern_connect(td, uap->s, sa));
+ error = kern_connect(td, uap->s, sa);
+ free(sa, M_SONAME);
+ return (error);
}
@@ -596,7 +599,6 @@ done1:
fdrop(fp, td);
done2:
NET_UNLOCK_GIANT();
- FREE(sa, M_SONAME);
return (error);
}
OpenPOWER on IntegriCloud