]> rtime.felk.cvut.cz Git - lisovros/iproute2_canprio.git/commitdiff
ip: fix memory leak in ipmaddr.c
authorBrandon Philips <bphilips@suse.de>
Wed, 23 Mar 2011 19:03:49 +0000 (12:03 -0700)
committerStephen Hemminger <shemminger@vyatta.com>
Tue, 12 Apr 2011 21:23:52 +0000 (14:23 -0700)
If the continue is taken, then there is a memory leak.

https://bugzilla.novell.com/show_bug.cgi?id=538996

Reported-by: David Binderman <dcb314@hotmail.com>
Signed-off-by: Brandon Philips <bphilips@suse.de>
ip/ipmaddr.c

index ec326bc007454419962b5f707cc93ecb46698b05..5a52c856f2d975ab3b021720949f4d5493c5ea28 100644 (file)
@@ -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);