X-Git-Url: https://git.octo.it/?a=blobdiff_plain;ds=sidebyside;f=src%2Fperl.c;h=0c5ee0c336c19bb19d60e70f588fd6da47f8c14c;hb=f0b5610723ae8962ae264f84210f8bac483bcd20;hp=0a98684e9e809f30be3eb042abe3a254bb028510;hpb=71478cd6550a4e930a1e9b8a906a66579e4e387a;p=collectd.git diff --git a/src/perl.c b/src/perl.c index 0a98684e..0c5ee0c3 100644 --- a/src/perl.c +++ b/src/perl.c @@ -1199,7 +1199,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); @@ -1640,15 +1643,15 @@ static XS (Collectd_plugin_dispatch_values) values = ST (/* stack index = */ 0); + if (NULL == values) + XSRETURN_EMPTY; + /* Make sure the argument is a hash reference. */ if (! (SvROK (values) && (SVt_PVHV == SvTYPE (SvRV (values))))) { log_err ("Collectd::plugin_dispatch_values: Invalid values."); XSRETURN_EMPTY; } - if (NULL == values) - XSRETURN_EMPTY; - ret = pplugin_dispatch_values (aTHX_ (HV *)SvRV (values)); if (0 == ret) @@ -2506,7 +2509,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);