diff options
author | /C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org </C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org> | 2008-01-17 17:16:54 +0000 |
---|---|---|
committer | /C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org </C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org> | 2008-01-17 17:16:54 +0000 |
commit | 5c7db5abef470bc6a0f2e3858a5fc75731c9f3bd (patch) | |
tree | 09816bc288f987c2ef33d1594f94824b9a963bf9 /src/mcast.c | |
parent | ab4f7c0abd2d42f20b8675b3bc552a88204ce4ad (diff) | |
download | conntrack-tools-5c7db5abef470bc6a0f2e3858a5fc75731c9f3bd.tar.gz conntrack-tools-5c7db5abef470bc6a0f2e3858a5fc75731c9f3bd.zip |
Max Kellermann <max@duempel.org>:
fix memory leaks in several error output paths
Diffstat (limited to 'src/mcast.c')
-rw-r--r-- | src/mcast.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mcast.c b/src/mcast.c index 185a7e2..9684b61 100644 --- a/src/mcast.c +++ b/src/mcast.c @@ -80,6 +80,8 @@ struct mcast_sock *mcast_server_create(struct mcast_conf *conf) if (ioctl(m->fd, SIOCGIFMTU, &ifr) == -1) { debug("ioctl"); + close(m->fd); + free(m); return NULL; } conf->mtu = ifr.ifr_mtu; @@ -201,6 +203,7 @@ struct mcast_sock *mcast_client_create(struct mcast_conf *conf) if ((m->fd = socket(conf->ipproto, SOCK_DGRAM, 0)) == -1) { debug("mcast_sock_client_create:socket"); + free(m); return NULL; } @@ -224,6 +227,7 @@ struct mcast_sock *mcast_client_create(struct mcast_conf *conf) } if (ret == -1) { + close(m->fd); free(m); m = NULL; } |