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 <mar.kolya@gmail.com>
Signed-off-by: default avatarDavid Woodhouse <dwmw2@infradead.org>
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)))
free(this);
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