diff --git a/msp_proxy.c b/msp_proxy.c index 8a41607f..b4c9cf25 100644 --- a/msp_proxy.c +++ b/msp_proxy.c @@ -573,9 +573,9 @@ end: mdp_close(mdp_sock.poll.fd); mdp_sock.poll.fd=-1; } - if (is_watching(&service_sock)) - unwatch(&service_sock); if (service_sock.poll.fd!=-1){ + if (is_watching(&service_sock)) + unwatch(&service_sock); mdp_close(service_sock.poll.fd); service_sock.poll.fd=-1; }