Commit ffee28a1 authored by Nikolay Martynov's avatar Nikolay Martynov Committed by David Woodhouse

Do not leak memory when tun was not created yet

Packets pulled off incoming queue should be freed
Signed-off-by: default avatarNikolay Martynov <>
Signed-off-by: default avatarDavid Woodhouse <>
parent 69793ae0
......@@ -51,8 +51,10 @@ int tun_mainloop(struct openconnect_info *vpninfo, int *timeout)
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)))
return 0;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment