libipsec: fix memory management when cloning ip_packet
authorMartin Willi <martin@revosec.ch>
Fri, 6 Sep 2013 12:16:14 +0000 (14:16 +0200)
committerMartin Willi <martin@revosec.ch>
Fri, 13 Sep 2013 11:56:44 +0000 (13:56 +0200)
src/libipsec/ip_packet.c

index d08e090..41e3643 100644 (file)
@@ -98,7 +98,7 @@ METHOD(ip_packet_t, get_next_header, u_int8_t,
 METHOD(ip_packet_t, clone, ip_packet_t*,
        private_ip_packet_t *this)
 {
-       return ip_packet_create(this->packet);
+       return ip_packet_create(chunk_clone(this->packet));
 }
 
 METHOD(ip_packet_t, destroy, void,