From: Florian Forster Date: Thu, 17 Dec 2015 14:13:39 +0000 (+0100) Subject: perl plugin: Check "return value" of PERL_GET_CONTEXT. X-Git-Tag: collectd-5.5.1~12^2 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=5a223866595c0d7eb032c3c4fc3c7cd148e59f99;p=collectd.git perl plugin: Check "return value" of PERL_GET_CONTEXT. CID: 37985 --- diff --git a/src/perl.c b/src/perl.c index 67cb842b..d42afc20 100644 --- a/src/perl.c +++ b/src/perl.c @@ -2509,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);