[glib] [tests/gvariant] Handle flavored_free(NULL), since flavored_malloc can return NULL



commit ba1163a33cdfb7f67cbd311ae2b74ae40831cd05
Author: Colin Walters <walters verbum org>
Date:   Wed May 26 15:59:36 2010 -0400

    [tests/gvariant] Handle flavored_free(NULL), since flavored_malloc can return NULL

 glib/tests/gvariant.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/glib/tests/gvariant.c b/glib/tests/gvariant.c
index 1a93607..59e50e4 100644
--- a/glib/tests/gvariant.c
+++ b/glib/tests/gvariant.c
@@ -1269,6 +1269,8 @@ static void
 flavoured_free (gpointer data,
                 gsize flavour)
 {
+  if (!data)
+    return;
   g_free (((gchar *) data) - flavour);
 }
 



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