]> arthur.barton.de Git - netdata.git/blobdiff - src/rrdpush.c
use calloc to initialize memory
[netdata.git] / src / rrdpush.c
index 2dcbe9f57f3af64f8276f5a1b2857a2ca177f1ae..f5f54d39a320e8158b2b7df2d4921510a0a6c1bc 100644 (file)
@@ -219,6 +219,8 @@ static void rrdpush_sender_thread_cleanup_locked_all(RRDHOST *host) {
     host->rrdpush_buffer = NULL;
 
     host->rrdpush_spawn = 0;
+
+    rrdhost_flag_set(host, RRDHOST_ORPHAN);
 }
 
 void rrdpush_sender_thread_stop(RRDHOST *host) {
@@ -453,7 +455,7 @@ cleanup:
 
     if(pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL) != 0)
         error("STREAM %s [send]: cannot set pthread cancel state to ENABLE.", host->hostname);
-    
+
     pthread_exit(NULL);
     return NULL;
 }
@@ -645,6 +647,7 @@ void rrdpush_sender_thread_spawn(RRDHOST *host) {
         else if(pthread_detach(host->rrdpush_thread))
             error("STREAM %s [send]: cannot request detach newly created thread.", host->hostname);
 
+        rrdhost_flag_clear(host, RRDHOST_ORPHAN);
         host->rrdpush_spawn = 1;
     }