aboutsummaryrefslogtreecommitdiff
path: root/net/socket.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2011-12-14 07:59:21 -0600
committerAnthony Liguori <aliguori@us.ibm.com>2011-12-14 07:59:21 -0600
commit9423a2e8dd362a271bfe194ec131062814557b95 (patch)
tree6b10b2d69e5d81b6ff4cb2ba75693d8a65362d92 /net/socket.c
parentda5361cc685c004d8bb4e7c5e7b3a52c7aca2c56 (diff)
parent126c79133f77d1b0b7c3849899c6d5f83b2fd410 (diff)
Merge remote-tracking branch 'stefanha/trivial-patches-next' into staging
Diffstat (limited to 'net/socket.c')
-rw-r--r--net/socket.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/socket.c b/net/socket.c
index f999c26597..aaf9be48e2 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -414,6 +414,7 @@ static int net_socket_listen_init(VLANState *vlan,
fd = qemu_socket(PF_INET, SOCK_STREAM, 0);
if (fd < 0) {
perror("socket");
+ g_free(s);
return -1;
}
socket_set_nonblock(fd);
@@ -425,11 +426,13 @@ static int net_socket_listen_init(VLANState *vlan,
ret = bind(fd, (struct sockaddr *)&saddr, sizeof(saddr));
if (ret < 0) {
perror("bind");
+ g_free(s);
return -1;
}
ret = listen(fd, 0);
if (ret < 0) {
perror("listen");
+ g_free(s);
return -1;
}
s->vlan = vlan;