[grilo/0.1.x] grl-net: avoid a possible double free
- From: Victor Manuel Jaquez Leal <vjaquez src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [grilo/0.1.x] grl-net: avoid a possible double free
- Date: Tue, 7 Aug 2012 11:17:08 +0000 (UTC)
commit cfb1bd8c6999f493639c6f533dac0a6c60040281
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]