summaryrefslogtreecommitdiff
path: root/src/plugins/logger
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2009-02-04 14:12:46 +0100
committerSebastien Helleu <flashcode@flashtux.org>2009-02-04 14:12:46 +0100
commit7cc562be45c781c085a8a4e9515ad527d327a2ef (patch)
treeb68e4722b07949b8c55d4ee4935b574aa178272e /src/plugins/logger
parentaeb11f7e05ede4453552a1fac6895da6e8f6084f (diff)
downloadweechat-7cc562be45c781c085a8a4e9515ad527d327a2ef.zip
Fix 14 memory leaks (in core, gui, irc, jabber, logger, script plugins)
Diffstat (limited to 'src/plugins/logger')
-rw-r--r--src/plugins/logger/logger-buffer.c2
-rw-r--r--src/plugins/logger/logger.c11
2 files changed, 7 insertions, 6 deletions
diff --git a/src/plugins/logger/logger-buffer.c b/src/plugins/logger/logger-buffer.c
index 280ecd1c6..0e3836ae3 100644
--- a/src/plugins/logger/logger-buffer.c
+++ b/src/plugins/logger/logger-buffer.c
@@ -183,6 +183,8 @@ logger_buffer_free (struct t_logger_buffer *logger_buffer)
if (logger_buffer->log_filename)
free (logger_buffer->log_filename);
+ free (logger_buffer);
+
logger_buffers = new_logger_buffers;
}
diff --git a/src/plugins/logger/logger.c b/src/plugins/logger/logger.c
index 93f9ae62e..9abff3d4e 100644
--- a/src/plugins/logger/logger.c
+++ b/src/plugins/logger/logger.c
@@ -307,6 +307,7 @@ logger_get_filename (struct t_gui_buffer *buffer)
free (log_path);
if (log_path2)
free (log_path2);
+ free (mask_decoded);
return res;
}
@@ -487,12 +488,9 @@ logger_stop (struct t_logger_buffer *logger_buffer, int write_info_line)
void
logger_stop_all ()
{
- struct t_logger_buffer *ptr_logger_buffer;
-
- for (ptr_logger_buffer = logger_buffers; ptr_logger_buffer;
- ptr_logger_buffer = ptr_logger_buffer->next_buffer)
+ while (logger_buffers)
{
- logger_stop (ptr_logger_buffer, 1);
+ logger_stop (logger_buffers, 1);
}
}
@@ -766,11 +764,12 @@ logger_backlog (struct t_gui_buffer *buffer, const char *filename, int lines)
pos_message = strchr (ptr_lines->data, '\t');
if (pos_message)
{
+ memset (&tm_line, 0, sizeof (struct tm));
pos_message[0] = '\0';
error = strptime (ptr_lines->data,
weechat_config_string (logger_config_file_time_format),
&tm_line);
- if (error && !error[0])
+ if (error && !error[0] && (tm_line.tm_year > 0))
datetime = mktime (&tm_line);
pos_message[0] = '\t';
}