[libgdata/libgdata-0-6] core: Fix a memory leak in an unlikely error condition
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgdata/libgdata-0-6] core: Fix a memory leak in an unlikely error condition
- Date: Wed, 29 Sep 2010 12:22:27 +0000 (UTC)
commit 8dc4c0887a1ccd2c47ddbf51da28605ce1d44c18
Author: Philip Withnall <philip withnall collabora co uk>
Date: Sat Aug 7 12:14:17 2010 +0100
core: Fix a memory leak in an unlikely error condition
gdata/gdata-parsable.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/gdata/gdata-parsable.c b/gdata/gdata-parsable.c
index 8b5c903..9f298a1 100644
--- a/gdata/gdata-parsable.c
+++ b/gdata/gdata-parsable.c
@@ -214,8 +214,10 @@ _gdata_parsable_new_from_xml_node (GType parsable_type, xmlDoc *doc, xmlNode *no
parsable = g_object_new (parsable_type, NULL);
klass = GDATA_PARSABLE_GET_CLASS (parsable);
- if (klass->parse_xml == NULL)
+ if (klass->parse_xml == NULL) {
+ g_object_unref (parsable);
return NULL;
+ }
g_assert (klass->element_name != NULL);
/* TODO: See gdata-documents-entry.c:260 for an example of where the code below doesn't work */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]