summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2014-08-10 13:25:35 +0200
committerSébastien Helleu <flashcode@flashtux.org>2014-08-10 13:25:35 +0200
commitfc1571645d1c776fc33b32300de9be09362ba867 (patch)
tree5d92226a4156e9d8fe01f4842f7521d2d6bbb8d6 /src/plugins
parent53a9a161f41bae36059ccd083d60544cb80f8a75 (diff)
downloadweechat-fc1571645d1c776fc33b32300de9be09362ba867.zip
logger: fix memory leaks in backlog
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/logger/logger-tail.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/plugins/logger/logger-tail.c b/src/plugins/logger/logger-tail.c
index 617a671c3..823825b71 100644
--- a/src/plugins/logger/logger-tail.c
+++ b/src/plugins/logger/logger-tail.c
@@ -101,6 +101,8 @@ logger_tail_file (const char *filename, int n_lines)
bytes_read = read (fd, buf, to_read);
if (bytes_read <= 0)
{
+ if (part_of_line)
+ free (part_of_line);
logger_tail_free (ptr_line);
close (fd);
return NULL;
@@ -140,6 +142,7 @@ logger_tail_file (const char *filename, int n_lines)
if (!new_line->data)
{
free (part_of_line);
+ free (new_line);
logger_tail_free (ptr_line);
close (fd);
return NULL;