diff options
Diffstat (limited to 'pflocal/sock.c')
-rw-r--r-- | pflocal/sock.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/pflocal/sock.c b/pflocal/sock.c index 2acf5f4e..174494cd 100644 --- a/pflocal/sock.c +++ b/pflocal/sock.c @@ -356,7 +356,11 @@ addr_get_sock (struct addr *addr, struct sock **sock) pthread_mutex_lock (&addr->lock); *sock = addr->sock; if (*sock) - (*sock)->refs++; + { + pthread_mutex_lock (&(*sock)->lock); + (*sock)->refs++; + pthread_mutex_unlock (&(*sock)->lock); + } pthread_mutex_unlock (&addr->lock); return *sock ? 0 : EADDRNOTAVAIL; } |