From: Brandon Philips Date: Wed, 23 Mar 2011 19:03:49 +0000 (-0700) Subject: ip: fix memory leak in ipmaddr.c X-Git-Url: http://rtime.felk.cvut.cz/gitweb/lisovros/iproute2_canprio.git/commitdiff_plain/1f7190db3920f76cca7fdcd1bb318c6cfa4a3266 ip: fix memory leak in ipmaddr.c If the continue is taken, then there is a memory leak. https://bugzilla.novell.com/show_bug.cgi?id=538996 Reported-by: David Binderman Signed-off-by: Brandon Philips --- diff --git a/ip/ipmaddr.c b/ip/ipmaddr.c index ec326bc..5a52c85 100644 --- a/ip/ipmaddr.c +++ b/ip/ipmaddr.c @@ -136,7 +136,7 @@ void read_igmp(struct ma_info **result_p) m.addr.bytelen = 4; while (fgets(buf, sizeof(buf), fp)) { - struct ma_info *ma = malloc(sizeof(m)); + struct ma_info *ma; if (buf[0] != '\t') { sscanf(buf, "%d%s", &m.index, m.name);