tipc/bearer: Fix resource leak in error path
Signed-off-by: Phil Sutter <phil@nwl.cc>
This commit is contained in:
parent
46131577cf
commit
be55416add
|
|
@ -163,6 +163,7 @@ static int nl_add_udp_enable_opts(struct nlmsghdr *nlh, struct opt *opts,
|
||||||
if (!remip) {
|
if (!remip) {
|
||||||
if (generate_multicast(loc->ai_family, buf, sizeof(buf))) {
|
if (generate_multicast(loc->ai_family, buf, sizeof(buf))) {
|
||||||
fprintf(stderr, "Failed to generate multicast address\n");
|
fprintf(stderr, "Failed to generate multicast address\n");
|
||||||
|
freeaddrinfo(loc);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
remip = buf;
|
remip = buf;
|
||||||
|
|
@ -177,6 +178,8 @@ static int nl_add_udp_enable_opts(struct nlmsghdr *nlh, struct opt *opts,
|
||||||
|
|
||||||
if (rem->ai_family != loc->ai_family) {
|
if (rem->ai_family != loc->ai_family) {
|
||||||
fprintf(stderr, "UDP local and remote AF mismatch\n");
|
fprintf(stderr, "UDP local and remote AF mismatch\n");
|
||||||
|
freeaddrinfo(rem);
|
||||||
|
freeaddrinfo(loc);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue