charon-tkm: Return cloned host from tkm_kernel_sad_t::get_dst_host()
[strongswan.git] / src / charon-tkm / src / tkm / tkm_kernel_sad.c
index 97226f1..c888f25 100644 (file)
@@ -283,7 +283,7 @@ METHOD(tkm_kernel_sad_t, get_dst_host, host_t *,
                                                                                        (void**)&entry, &reqid, &spi, &proto);
        if (res && entry)
        {
-               dst = entry->dst;
+               dst = entry->dst->clone(entry->dst);
                DBG3(DBG_KNL, "returning destination host %H of SAD entry (reqid: %u,"
                         " spi: %x, proto: %u)", dst, reqid, ntohl(spi), proto);
        }