diff options
author | Jiri Pirko <jiri@resnulli.us> | 2013-03-16 17:04:23 +0100 |
---|---|---|
committer | Jiri Pirko <jiri@resnulli.us> | 2013-03-17 11:11:48 +0100 |
commit | 7c5157f47a7d82c33d638e15d08ae1151ddb9f9f (patch) | |
tree | a4ccff925351acf6016a90ab6d05d969f27cb233 /libndp/libndp.c | |
parent | ca1d228df4b8bbdb8e59a6fcf3e6a57f50a37049 (diff) | |
download | libndp-7c5157f47a7d82c33d638e15d08ae1151ddb9f9f.tar.gz |
lib: fix memory leak on receiving small packets
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Diffstat (limited to 'libndp/libndp.c')
-rw-r--r-- | libndp/libndp.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libndp/libndp.c b/libndp/libndp.c index ded88b4..02f7946 100644 --- a/libndp/libndp.c +++ b/libndp/libndp.c @@ -1103,7 +1103,8 @@ static int ndp_sock_recv(struct ndp *ndp) if (len < sizeof(*msg->icmp6_hdr)) { warn(ndp, "rcvd icmp6 packet too short (%luB)", len); - return 0; + err = 0; + goto free_msg; } err = ndp_msg_type_by_raw_type(&msg_type, msg->icmp6_hdr->icmp6_type); if (err) |