system-linux: fix memory leak in system_bridge_vlan_check
authorFelix Fietkau <nbd@nbd.name>
Sun, 4 Jun 2023 16:34:01 +0000 (18:34 +0200)
committerFelix Fietkau <nbd@nbd.name>
Sun, 4 Jun 2023 16:35:00 +0000 (18:35 +0200)
The message passed to nl_send_auto_complete still needs to be freed
even in the normal path

Fixes: https://github.com/openwrt/netifd/issues/4
Fixes: 85f01c44a950 ("bridge: check bridge port vlan membership on link-up events")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
system-linux.c

index 432581eeb8e4e3fdc97a082af218b18cad4c8cb1..cc15537ba3ad6cd4b9e96f5a389c36dfef1a4018 100644 (file)
@@ -2205,11 +2205,8 @@ int system_bridge_vlan_check(struct device *dev, char *ifname)
                }
        }
 
-       goto out;
-
 free:
        nlmsg_free(msg);
-out:
        nl_cb_put(cb);
        return data.ret;
 }