From: Florian Forster Date: Tue, 8 Dec 2015 13:38:05 +0000 (+0100) Subject: ping plugin: Protect access to ping_thread_error. X-Git-Tag: collectd-5.5.1~13^2~5 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=dc0e64a5811fe065ca88b5c973f4db0dd6f1355f;p=collectd.git ping plugin: Protect access to ping_thread_error. This is primarily to make Coverity happy. CID: 37976 --- diff --git a/src/ping.c b/src/ping.c index e1a31092..ecbbd9d0 100644 --- a/src/ping.c +++ b/src/ping.c @@ -416,8 +416,10 @@ static int stop_thread (void) /* {{{ */ status = -1; } + pthread_mutex_lock (&ping_lock); memset (&ping_thread_id, 0, sizeof (ping_thread_id)); ping_thread_error = 0; + pthread_mutex_unlock (&ping_lock); return (status); } /* }}} int stop_thread */