[gtksourceview/wip/public-region] SearchContext: fix potential memory leak
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview/wip/public-region] SearchContext: fix potential memory leak
- Date: Sat, 2 Apr 2016 10:53:05 +0000 (UTC)
commit b96a8acdba51951cf5e548e5b3557b697d699aeb
Author: Sébastien Wilmet <swilmet gnome org>
Date: Sat Apr 2 12:51:33 2016 +0200
SearchContext: fix potential memory leak
gtksourceview/gtksourcesearchcontext.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/gtksourceview/gtksourcesearchcontext.c b/gtksourceview/gtksourcesearchcontext.c
index 9a770e0..7f32b31 100644
--- a/gtksourceview/gtksourcesearchcontext.c
+++ b/gtksourceview/gtksourcesearchcontext.c
@@ -1779,6 +1779,11 @@ regex_search_handle_high_priority_region (GtkSourceSearchContext *search)
&start,
&end);
+ if (region == NULL)
+ {
+ return;
+ }
+
gtk_source_region_get_start_region_iter (region, ®ion_iter);
while (!gtk_source_region_iter_is_end (®ion_iter))
@@ -1790,7 +1795,7 @@ regex_search_handle_high_priority_region (GtkSourceSearchContext *search)
&subregion_start,
&subregion_end))
{
- return;
+ break;
}
gtk_text_buffer_remove_tag (search->priv->buffer,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]