From: Brandon Philips Date: Wed, 23 Mar 2011 19:03:49 +0000 (-0700) Subject: ip: fix memory leak in ipmaddr.c X-Git-Tag: v2.6.39~13^2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1f7190db3920f76cca7fdcd1bb318c6cfa4a3266;p=thirdparty%2Fiproute2.git 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 ec326bc00..5a52c856f 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);