[grilo] grl-net: avoid a possible double free



commit 4f046878faeccdd6548bb17471e7a22dd9d91758
Author: VÃctor Manuel JÃquez Leal <vjaquez igalia com>
Date:   Tue Aug 7 12:51:14 2012 +0200

    grl-net: avoid a possible double free
    
    In the soup-unstable there was the possiblity to face a double
    free if get_content() was called twice with the content parameter
    set as NULL first.
    
    Thanks to Jens Georg for aiming at this issue.

 libs/net/grl-net-soup-unstable.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/libs/net/grl-net-soup-unstable.c b/libs/net/grl-net-soup-unstable.c
index de96f50..275aa10 100644
--- a/libs/net/grl-net-soup-unstable.c
+++ b/libs/net/grl-net-soup-unstable.c
@@ -275,8 +275,11 @@ get_content (GrlNetWc *self,
 
   if (content)
     *content = self->priv->previous_data;
-  else
+  else {
     g_free (rr->buffer);
+    self->priv->previous_data = NULL;
+    rr->buffer = NULL;
+  }
 
   if (length)
     *length = rr->offset;



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