From: Sebastian Harl Date: Mon, 16 Feb 2009 12:39:54 +0000 (+0100) Subject: perl plugin: Do not pass NULL to newRV(). X-Git-Tag: collectd-4.6.0~10 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=90760db56fa3fe54e1aa99d7c6914b544b1bf16d;p=collectd.git perl plugin: Do not pass NULL to newRV(). newRV() does not handle that correctly and causes a segfault instead. Now, we use PL_sv_undef instead. --- diff --git a/src/perl.c b/src/perl.c index f9c99387..9f91d018 100644 --- a/src/perl.c +++ b/src/perl.c @@ -992,14 +992,14 @@ static int pplugin_call_all (pTHX_ int type, ...) if (-1 == data_set2av (aTHX_ ds, pds)) { av_clear (pds); av_undef (pds); - pds = Nullav; + pds = (AV *)&PL_sv_undef; ret = -1; } if (-1 == value_list2hv (aTHX_ vl, ds, pvl)) { hv_clear (pvl); hv_undef (pvl); - pvl = Nullhv; + pvl = (HV *)&PL_sv_undef; ret = -1; } @@ -1038,7 +1038,7 @@ static int pplugin_call_all (pTHX_ int type, ...) if (-1 == notification2hv (aTHX_ n, notif)) { hv_clear (notif); hv_undef (notif); - notif = Nullhv; + notif = (HV *)&PL_sv_undef; ret = -1; } @@ -2023,7 +2023,7 @@ static int perl_config_plugin (pTHX_ oconfig_item_t *ci) hv_undef (config); log_err ("Unable to convert configuration to a Perl hash value."); - config = Nullhv; + config = (HV *)&PL_sv_undef; } ENTER;