diff options
author | Mikael Magnusson <mikma@users.sourceforge.net> | 2020-05-13 17:37:07 +0200 |
---|---|---|
committer | Mikael Magnusson <mikma@users.sourceforge.net> | 2020-05-13 17:37:07 +0200 |
commit | 899b0ccad5d4bfeaad70293690f45273274c75e9 (patch) | |
tree | 97313a6b82e9d624a5583e97b6c5f7d8d514647d /sysdep/unix | |
parent | 92479e318f2dd3373099f191df7d2ab268bab34d (diff) |
close socket fixing leak
Diffstat (limited to 'sysdep/unix')
-rw-r--r-- | sysdep/unix/wg_user.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sysdep/unix/wg_user.c b/sysdep/unix/wg_user.c index 8c8f9dc4..1446d20b 100644 --- a/sysdep/unix/wg_user.c +++ b/sysdep/unix/wg_user.c @@ -262,6 +262,9 @@ wg_user_set_device(struct pool *pool, res = sk_send(sock, tbsize - size); /* Send data, <0=err, >0=ok, 0=sleep */ DBG(L_TRACE "WG: send %d", res); + if (res != 0) { + rfree(sock); + } /* abort(); */ return -1; |