X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fperl.c;h=d247dc0eece612568bce01e2edaee4fdb5326193;hb=6c613b51563736dcb081aaa20490f16458338336;hp=78e508ae4d1f1bb7c0b9ae5c9ca340b9685e79e6;hpb=3b51243382501d5f3cdda79d30c7ecf39d22dd87;p=collectd.git diff --git a/src/perl.c b/src/perl.c index 78e508ae..d247dc0e 100644 --- a/src/perl.c +++ b/src/perl.c @@ -510,7 +510,6 @@ static int av2notification_meta (pTHX_ AV *array, notification_meta_t **meta) if (NULL == (tmp = hv_fetch (hash, "value", 5, 0))) { log_warn ("av2notification_meta: Skipping invalid " "meta information."); - free ((*m)->name); free (*m); continue; } @@ -1203,7 +1202,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); @@ -1644,15 +1646,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) @@ -2510,7 +2512,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);