Packets pulled off incoming queue should be freed
Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
int work_done = 0;
if (!tun_is_up(vpninfo)) {
- /* no tun yet, clear any queued packets */
- while ((this = dequeue_packet(&vpninfo->incoming_queue)));
+ /* no tun yet; clear any queued packets */
+ while ((this = dequeue_packet(&vpninfo->incoming_queue)))
+ free(this);
+
return 0;
}