summaryrefslogtreecommitdiff
path: root/src/plugins/scripts/perl
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2010-02-27 09:58:24 +0100
committerSebastien Helleu <flashcode@flashtux.org>2010-02-27 09:58:24 +0100
commit282f786c1a75978ea0ad4399b7740abd6ff6486a (patch)
tree60902c245e7dc8e0c9cfbe38fbb33edd2e52d0de /src/plugins/scripts/perl
parent62aff3f1c6ccec7dc2ae0bc92bbd185666532287 (diff)
downloadweechat-282f786c1a75978ea0ad4399b7740abd6ff6486a.zip
Fix crash in Perl plugin when callbacks are called during script initialization (bug #29018)
Diffstat (limited to 'src/plugins/scripts/perl')
-rw-r--r--src/plugins/scripts/perl/weechat-perl.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/scripts/perl/weechat-perl.c b/src/plugins/scripts/perl/weechat-perl.c
index 50ee2845b..15a741545 100644
--- a/src/plugins/scripts/perl/weechat-perl.c
+++ b/src/plugins/scripts/perl/weechat-perl.c
@@ -148,7 +148,8 @@ weechat_perl_exec (struct t_plugin_script *script,
(void) length;
func = (char *) function;
old_context = PERL_GET_CONTEXT;
- PERL_SET_CONTEXT (script->interpreter);
+ if (script->interpreter)
+ PERL_SET_CONTEXT (script->interpreter);
#else
length = strlen (script->interpreter) + strlen (function) + 3;
func = (char *) malloc (length);