netstat: fix double-free in netlink error code path.
CID: 1504382
This commit is contained in:
parent
aee2f11bf4
commit
9ee6278b78
@ -91,10 +91,8 @@ prepare_ifmap_netlink(struct snl_state *ss, size_t *pifmap_size)
|
|||||||
};
|
};
|
||||||
msg.hdr.nlmsg_len = sizeof(msg);
|
msg.hdr.nlmsg_len = sizeof(msg);
|
||||||
|
|
||||||
if (!snl_send_message(ss, &msg.hdr)) {
|
if (!snl_send_message(ss, &msg.hdr))
|
||||||
snl_free(ss);
|
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
|
||||||
|
|
||||||
struct ifmap_entry *ifmap = NULL;
|
struct ifmap_entry *ifmap = NULL;
|
||||||
uint32_t ifmap_size = 0;
|
uint32_t ifmap_size = 0;
|
||||||
@ -286,6 +284,10 @@ p_rtable_netlink(int fibnum, int af)
|
|||||||
return (false);
|
return (false);
|
||||||
|
|
||||||
ifmap = prepare_ifmap_netlink(&ss, &ifmap_size);
|
ifmap = prepare_ifmap_netlink(&ss, &ifmap_size);
|
||||||
|
if (ifmap == NULL) {
|
||||||
|
snl_free(&ss);
|
||||||
|
return (false);
|
||||||
|
}
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
struct nlmsghdr hdr;
|
struct nlmsghdr hdr;
|
||||||
|
Loading…
Reference in New Issue
Block a user