Merge pull request #2365 from donaldsharp/vxlan_mem_leak

zebra: Fix memory leak on host prefix removal
This commit is contained in:
Renato Westphal 2018-06-05 11:50:35 -03:00 committed by GitHub
commit 0071b5f1b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3111,8 +3111,10 @@ static void rb_delete_host(struct host_rb_tree_entry *hrbe, struct prefix *host)
memcpy(&lookup.p, host, sizeof(*host)); memcpy(&lookup.p, host, sizeof(*host));
hle = RB_FIND(host_rb_tree_entry, hrbe, &lookup); hle = RB_FIND(host_rb_tree_entry, hrbe, &lookup);
if (hle) if (hle) {
RB_REMOVE(host_rb_tree_entry, hrbe, hle); RB_REMOVE(host_rb_tree_entry, hrbe, hle);
XFREE(MTYPE_HOST_PREFIX, hle);
}
return; return;
} }