From: Fredrik Tolf Date: Sun, 16 Mar 2008 05:03:39 +0000 (+0100) Subject: Fixed sleeping SEGV. X-Git-Tag: 1.3~26 X-Git-Url: http://git.dolda2000.com/gitweb/?a=commitdiff_plain;h=7dddb55155279338957831e7122d5d266acde0f6;p=doldaconnect.git Fixed sleeping SEGV. --- diff --git a/daemon/net.c b/daemon/net.c index 242f10e..fa84564 100644 --- a/daemon/net.c +++ b/daemon/net.c @@ -365,13 +365,16 @@ static void freesock(struct socket *sk) void putsock(struct socket *sk) { + struct socket *back; + if(--(sk->refcount) < 0) { flog(LOG_CRIT, "BUG: socket refcount < 0"); abort(); } if((sk->refcount == 0) && (sk->back->refcount == 0)) { + back = sk->back; freesock(sk); - freesock(sk->back); + freesock(back); } }