From f63a63a008055bb9d1e63ab48dd2342a89992c2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrico=20Tr=C3=B6ger?= Date: Tue, 24 Feb 2009 18:25:57 +0000 Subject: [PATCH] Fix missing NULL checks when reading the colour value of compiler output messages. git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3595 ea778897-0a13-0410-b9d1-a72fbfd435f5 --- ChangeLog | 3 +++ src/msgwindow.c | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4ce2841d..c39558e5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,9 @@ * configure.in, plugins/Makefile.am: Enable socket support when cross-compiling. Enable plugin compilation when cross-compiling. + * src/msgwindow.c: + Fix missing NULL checks when reading the colour value of compiler + output messages. 2009-02-20 Frank Lanitz diff --git a/src/msgwindow.c b/src/msgwindow.c index 298e86be..5611ee32 100644 --- a/src/msgwindow.c +++ b/src/msgwindow.c @@ -586,9 +586,10 @@ gboolean msgwin_goto_compiler_file_line() { /* if the item is not coloured red, it's not an error line */ gtk_tree_model_get(model, &iter, 0, &color, -1); - if (! gdk_color_equal(color, &color_error)) + if (color == NULL || ! gdk_color_equal(color, &color_error)) { - gdk_color_free(color); + if (color != NULL) + gdk_color_free(color); return FALSE; } gdk_color_free(color);