[grilo] net: Check if headers are NULL



commit a9fad347ef103c5b0ca8c555e2d50bc099a76a74
Author: Juan A. Suarez Romero <jasuarez igalia com>
Date:   Tue Sep 25 11:31:40 2012 +0200

    net: Check if headers are NULL

 libs/net/grl-net-wc.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/libs/net/grl-net-wc.c b/libs/net/grl-net-wc.c
index 3ee7471..e4fb249 100644
--- a/libs/net/grl-net-wc.c
+++ b/libs/net/grl-net-wc.c
@@ -298,7 +298,9 @@ get_url_delayed (gpointer user_data)
   get_url_now (c->self, c->url, c->headers, c->result, c->cancellable);
 
   g_free (c->url);
-  g_hash_table_unref (c->headers);
+  if (c->headers) {
+    g_hash_table_unref (c->headers);
+  }
   g_free (c);
 
   return FALSE;
@@ -331,7 +333,7 @@ get_url (GrlNetWc *self,
   c = g_new (struct request_clos, 1);
   c->self = self;
   c->url = g_strdup (url);
-  c->headers = g_hash_table_ref (headers);
+  c->headers = headers? g_hash_table_ref (headers): NULL;
   c->result = result;
   c->cancellable = cancellable;
 



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