diff --git a/gtests/net/packetdrill/packet.c b/gtests/net/packetdrill/packet.c index 4fcc6b9cccd10b832906a869c7c58d8db07ccdc6..5d33c14a5ce79eb37f33f686e10b057038a35330 100644 --- a/gtests/net/packetdrill/packet.c +++ b/gtests/net/packetdrill/packet.c @@ -178,11 +178,12 @@ static struct packet *packet_copy_with_headroom(struct packet *old_packet, packet->udplite = offset_ptr(old_base, new_base, old_packet->udplite); packet->icmpv4 = offset_ptr(old_base, new_base, old_packet->icmpv4); packet->icmpv6 = offset_ptr(old_base, new_base, old_packet->icmpv6); - - if (old_packet->chunk_list == NULL) { + + if (old_packet->chunk_list == NULL) { + sctp_chunk_list_free(packet->chunk_list); packet->chunk_list = NULL; return packet; - } + } /* Go through the SCTP specific lists */ for (old_chunk_item = old_packet->chunk_list->first;