[gtk+/optimize-height-for-width: 4/4] Fixed possible segmentation fault while freeing size request caches.



commit 5989a6405fb39567a39e2e49824c465246d26cee
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date:   Sun Mar 6 17:13:32 2011 +0900

    Fixed possible segmentation fault while freeing size request caches.

 gtk/gtksizerequest.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtksizerequest.c b/gtk/gtksizerequest.c
index 95cf2fa..adc2187 100644
--- a/gtk/gtksizerequest.c
+++ b/gtk/gtksizerequest.c
@@ -112,7 +112,7 @@ clear_cache (SizeRequestCache   *cache,
 
   if (sizes)
     {
-      for (i = 0; sizes[i] != NULL; i++)
+      for (i = 0; i < GTK_SIZE_REQUEST_CACHED_SIZES && sizes[i] != NULL; i++)
 	g_slice_free (SizeRequest, sizes[i]);
       
       g_slice_free1 (sizeof (SizeRequest *) * GTK_SIZE_REQUEST_CACHED_SIZES, sizes);



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