perl: Don't call detach after failed perl_parse
authorNikolai Kondrashov <Nikolai.Kondrashov@redhat.com>
Tue, 30 Sep 2014 13:19:47 +0000 (16:19 +0300)
committerNikolai Kondrashov <Nikolai.Kondrashov@redhat.com>
Tue, 30 Sep 2014 13:51:00 +0000 (16:51 +0300)
commite811b8e9ee7124753b051bbb16e1ed59542ce4a9
treea670302fdafa017dc5ce820a78756ee652f6e46e
parenta627dec52a45a90b0ebeecd5a76e04cadc84e698
perl: Don't call detach after failed perl_parse

Don't call "detach" callback in rlm_perl, if perl_parse of the Perl
module failed.

This fixes segfault when the module file cannot be read:

    Can't open perl script "/etc/raddb/mods-config/perl/example.pl": Permission denied
    rlm_perl: perl_parse failed: /etc/raddb/mods-config/perl/example.pl not found or has syntax errors.
    /etc/raddb/mods-enabled/perl[7]: Instantiation failed for module "perl"
    Segmentation fault
src/modules/rlm_perl/rlm_perl.c