changeset 13668:5c8565315d3e

[gaim-migrate @ 16070] CID 104: Function: trillian_logger_list Description: Variable "data" tracked as NULL was dereferenced. Yet another reminder that I need to work on this plugin again. committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Thu, 20 Apr 2006 05:12:22 +0000
parents f8a44204b1bc
children 3c395481f10c
files plugins/log_reader.c
diffstat 1 files changed, 9 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/log_reader.c	Thu Apr 20 04:58:29 2006 +0000
+++ b/plugins/log_reader.c	Thu Apr 20 05:12:22 2006 +0000
@@ -1131,17 +1131,17 @@
 
 			*c = '\0';
 			if (gaim_str_has_prefix(line, "Session Close ")) {
-				if (data && !data->length)
-					data->length = last_line_offset - data->offset;
-				if (!data->length) {
-					/* This log had no data, so we remove it. */
-					GList *last = g_list_last(list);
+				if (data && !data->length) {
+					if (!(data->length = last_line_offset - data->offset)) {
+						/* This log had no data, so we remove it. */
+						GList *last = g_list_last(list);
 
-					gaim_debug(GAIM_DEBUG_INFO, "Trillian log list",
-						"Empty log. Offset %i\n", data->offset);
+						gaim_debug(GAIM_DEBUG_INFO, "Trillian log list",
+							"Empty log. Offset %i\n", data->offset);
 
-					trillian_logger_finalize((GaimLog *)last->data);
-					list = g_list_delete_link(list, last);
+						trillian_logger_finalize((GaimLog *)last->data);
+						list = g_list_delete_link(list, last);
+					}
 				}
 			} else if (line[0] && line[1] && line [3] &&
 					   gaim_str_has_prefix(&line[3], "sion Start ")) {