xfrm: fix memory leak for encap original address

Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
Signed-off-by: Thomas Haller <thaller@redhat.com>

http://lists.infradead.org/pipermail/libnl/2016-June/002141.html
This commit is contained in:
Thomas Egerer 2016-06-10 11:57:55 +02:00 committed by Thomas Haller
parent 0ee916bf6b
commit 01bd6ef7e0

View File

@ -110,8 +110,11 @@ static void xfrm_sa_free_data(struct nl_object *c)
free (sa->crypt);
if (sa->comp)
free (sa->comp);
if (sa->encap)
free (sa->encap);
if (sa->encap) {
if (sa->encap->encap_oa)
nl_addr_put(sa->encap->encap_oa);
free(sa->encap);
}
if (sa->coaddr)
nl_addr_put (sa->coaddr);
if (sa->sec_ctx)