summaryrefslogtreecommitdiff
path: root/gweb
diff options
context:
space:
mode:
authorMohamed Abbas <mabbas@linux.intel.com>2011-01-25 14:17:37 -0800
committerSamuel Ortiz <sameo@linux.intel.com>2011-01-26 00:41:55 +0100
commitfa6cd58e1ef6db93cb20f9843f0a620e7e4ad1a9 (patch)
tree391771fcf0fa7d84421370fbb6e02116bfafa215 /gweb
parent15a1cf2d279ff7a2e8bf85e8a52cfec1cde0e525 (diff)
downloadconnman-fa6cd58e1ef6db93cb20f9843f0a620e7e4ad1a9.tar.gz
connman-fa6cd58e1ef6db93cb20f9843f0a620e7e4ad1a9.tar.bz2
connman-fa6cd58e1ef6db93cb20f9843f0a620e7e4ad1a9.zip
gweb: Check GString pointers before freeing them
Fixes BMC#12452
Diffstat (limited to 'gweb')
-rw-r--r--gweb/gweb.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/gweb/gweb.c b/gweb/gweb.c
index 5de10836..7387e7c3 100644
--- a/gweb/gweb.c
+++ b/gweb/gweb.c
@@ -151,10 +151,16 @@ static void free_session(struct web_session *session)
g_io_channel_unref(session->transport_channel);
g_free(session->result.last_key);
- g_hash_table_destroy(session->result.headers);
- g_string_free(session->send_buffer, TRUE);
- g_string_free(session->current_header, TRUE);
+ if (session->result.headers != NULL)
+ g_hash_table_destroy(session->result.headers);
+
+ if (session->send_buffer != NULL)
+ g_string_free(session->send_buffer, TRUE);
+
+ if (session->current_header != NULL)
+ g_string_free(session->current_header, TRUE);
+
g_free(session->receive_buffer);
g_free(session->content_type);