Commit Message

some attributes are pointers to malloc'd objects. Simply
copying the pointer results in use-after free
when the original or the clone is destroyed.
Also, add test case for cloned objects to ensure that
ct = nfct_new();
ct2 = nfct_clone(ct);
nfct_destroy(ct);
nfct_destroy(ct2);
won't crash due to double-frees.
Signed-off-by: Florian Westphal <fw@strlen.de>
---
When working on the connlabel stuff I noticed that nfct_clone does a
plain memcpy. Afaics nfct_clone has returned a shallow copy for ages.
But documentation implies that it really should do a deep copy.
Pablo, could you please double-check? Thanks!
qa/test_api.c | 6 ++++++
src/conntrack/api.c | 2 +-
2 files changed, 7 insertions(+), 1 deletions(-)