aboutsummaryrefslogtreecommitdiff
path: root/net/slirp.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2014-11-21 14:15:37 +0000
committerPeter Maydell <peter.maydell@linaro.org>2014-11-21 14:15:37 +0000
commit0e88f478508b566152c6681f4889ed9830a2c0a5 (patch)
tree0e6684291da7821000a2bd3e78e56b55af322242 /net/slirp.c
parenta00c1173385741007f71ce505d092f4cc174f449 (diff)
parentb0af844007841609cc11fab58f838bd105cbe144 (diff)
Merge remote-tracking branch 'remotes/stefanha/tags/net-pull-request' into staging
# gpg: Signature made Fri 21 Nov 2014 11:12:37 GMT using RSA key ID 81AB73C8 # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" # gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>" * remotes/stefanha/tags/net-pull-request: rtl8139: fix Pointer to local outside scope pcnet: fix Negative array index read net/socket: fix Uninitialized scalar variable net/slirp: fix memory leak Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'net/slirp.c')
-rw-r--r--net/slirp.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/net/slirp.c b/net/slirp.c
index dc89e6b086..377d7ef8c0 100644
--- a/net/slirp.c
+++ b/net/slirp.c
@@ -643,17 +643,16 @@ static int slirp_guestfwd(SlirpState *s, const char *config_str,
goto fail_syntax;
}
- fwd = g_malloc(sizeof(struct GuestFwd));
snprintf(buf, sizeof(buf), "guestfwd.tcp.%d", port);
if ((strlen(p) > 4) && !strncmp(p, "cmd:", 4)) {
if (slirp_add_exec(s->slirp, 0, &p[4], &server, port) < 0) {
error_report("conflicting/invalid host:port in guest forwarding "
"rule '%s'", config_str);
- g_free(fwd);
return -1;
}
} else {
+ fwd = g_malloc(sizeof(struct GuestFwd));
fwd->hd = qemu_chr_new(buf, p, NULL);
if (!fwd->hd) {
error_report("could not open guest forwarding device '%s'", buf);