aboutsummaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/socket.c3
-rw-r--r--net/tap-solaris.c2
2 files changed, 4 insertions, 1 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;
diff --git a/net/tap-solaris.c b/net/tap-solaris.c
index c216d28267..cf764634ef 100644
--- a/net/tap-solaris.c
+++ b/net/tap-solaris.c
@@ -65,7 +65,7 @@ static int tap_alloc(char *dev, size_t dev_size)
static int arp_fd = 0;
int ip_muxid, arp_muxid;
struct strioctl strioc_if, strioc_ppa;
- int link_type = I_PLINK;;
+ int link_type = I_PLINK;
struct lifreq ifr;
char actual_name[32] = "";