X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fperl.c;h=3b498f9b7ea348caf5048bc27932ccf3e0deb714;hb=348fa4567cf9326e4150c12741df705c31085a4c;hp=1ce09f4df19c963849175595096fd6a4d6fb6af4;hpb=791e99923dbbf045b11fbd7b0ea8df647e29593e;p=collectd.git diff --git a/src/perl.c b/src/perl.c index 1ce09f4d..3b498f9b 100644 --- a/src/perl.c +++ b/src/perl.c @@ -1208,7 +1208,10 @@ static void c_ithread_destructor (void *arg) /* the ithread no longer exists */ if (NULL == t) + { + pthread_mutex_unlock (&perl_threads->mutex); return; + } c_ithread_destroy (ithread); @@ -2515,7 +2518,10 @@ static int perl_config (oconfig_item_t *ci) int current_status = 0; if (NULL != perl_threads) - aTHX = PERL_GET_CONTEXT; + { + if ((aTHX = PERL_GET_CONTEXT) == NULL) + return -1; + } if (0 == strcasecmp (c->key, "LoadPlugin")) current_status = perl_config_loadplugin (aTHX_ c);