[epiphany-extensions] adblock: reset error to NULL if list regexp could not be parsed



commit feabc53b368c244215d3ba507abe76071f9ef81f
Author: Tim-Philipp Müller <tim centricular net>
Date:   Sun May 29 20:36:40 2011 +0100

    adblock: reset error to NULL if list regexp could not be parsed
    
    Reset (freed) error variable to NULL after a regexp parsing error
    from the whitelist/blacklist file. It's reused in the next loop
    iteration and if we don't reset it, we get critical warnings when
    reading further regexp lines, and then crashes when trying to
    print or free the already-freed error.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=595094

 extensions/adblock/adblock-pattern.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
---
diff --git a/extensions/adblock/adblock-pattern.c b/extensions/adblock/adblock-pattern.c
index 5630153..55968e1 100644
--- a/extensions/adblock/adblock-pattern.c
+++ b/extensions/adblock/adblock-pattern.c
@@ -79,6 +79,7 @@ adblock_pattern_load_from_file (GHashTable *patterns,
 				   "Error: %s",
 				   line, error->message);
 			g_error_free (error);
+			error = NULL;
 			continue;
 		}
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]