summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pflocal/pf.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/pflocal/pf.c b/pflocal/pf.c
index 0f0e2d9c..24fc7936 100644
--- a/pflocal/pf.c
+++ b/pflocal/pf.c
@@ -53,9 +53,13 @@ S_socket_create (mach_port_t pf,
err = sock_create (pipe_class, &sock);
if (!err)
- err = sock_create_port (sock, port);
- if (!err)
- *port_type = MACH_MSG_TYPE_MAKE_SEND;
+ {
+ err = sock_create_port (sock, port);
+ if (err)
+ sock_free (sock);
+ else
+ *port_type = MACH_MSG_TYPE_MAKE_SEND;
+ }
return err;
}