summaryrefslogtreecommitdiff
path: root/src/perl/perl-core.c
diff options
context:
space:
mode:
authorValentin Batz <senneth@irssi.org>2005-02-06 21:31:58 +0000
committervb <vb@dbcabf3a-b0e7-0310-adc4-f8d773084564>2005-02-06 21:31:58 +0000
commit19e800cf236bc8258b9a19a0685dac383f9f82ec (patch)
tree87050afe454aaad28956d12b9bd9e179345ff729 /src/perl/perl-core.c
parenta5fdd2358f96b766c5f1a358eb185717bf29cbae (diff)
downloadirssi-19e800cf236bc8258b9a19a0685dac383f9f82ec.zip
Fixed memory leaks when destroying a channel, when loading nonexisten scripts and in topics, patch by Toby Peterson
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3707 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/perl/perl-core.c')
-rw-r--r--src/perl/perl-core.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/perl/perl-core.c b/src/perl/perl-core.c
index 7f05314f..5733db14 100644
--- a/src/perl/perl-core.c
+++ b/src/perl/perl-core.c
@@ -373,11 +373,13 @@ char *perl_script_get_path(const char *name)
/* check from SCRIPTDIR */
g_free(path);
path = g_strdup_printf(SCRIPTDIR"/%s", file);
- if (stat(path, &statbuf) != 0)
- path = NULL;
+ if (stat(path, &statbuf) != 0) {
+ g_free(path);
+ path = NULL;
+ }
}
g_free(file);
- return path;
+ return path;
}
/* If core should handle printing script errors */