From: Sebastian Harl Date: Thu, 29 May 2008 22:12:36 +0000 (+0200) Subject: perl plugin: Fixed a segfault that appeared in Perl 5.10. X-Git-Tag: collectd-4.4.1~2 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=f1bc46b00671022cdd85c458c53bdbd10853903c;p=collectd.git perl plugin: Fixed a segfault that appeared in Perl 5.10. In Perl 5.10, av_clear() (amongst others) does no longer allow NULL for the passed array object pointer, thus we have to check for it ourselves. Signed-off-by: Sebastian Harl Signed-off-by: Florian Forster --- diff --git a/src/perl.c b/src/perl.c index 9bd3b4d2..2bd03afd 100644 --- a/src/perl.c +++ b/src/perl.c @@ -1118,7 +1118,7 @@ static c_ithread_t *c_ithread_create (PerlInterpreter *base) aTHX = t->interp; - if (NULL != base) { + if ((NULL != base) && (NULL != PL_endav)) { av_clear (PL_endav); av_undef (PL_endav); PL_endav = Nullav;