From: Thadeu Lima de Souza Cascardo Date: Sat, 9 Aug 2008 20:25:05 +0000 (-0300) Subject: If it is not possible to parse document, return NULL X-Git-Url: http://git.cascardo.info/?p=cascardo%2Fatompub.git;a=commitdiff_plain;h=7f2086782d486ad9188f2a7c9d2e8d55061494c2 If it is not possible to parse document, return NULL --- diff --git a/atom/entry.c b/atom/entry.c index d9d1f2a..c78a916 100644 --- a/atom/entry.c +++ b/atom/entry.c @@ -55,6 +55,11 @@ atom_entry_new_data_len (char *data, size_t len) xmlNodePtr child; entry = g_slice_new0 (AtomEntry); entry->doc = xmlReadMemory (data, len, NULL, NULL, XML_PARSE_RECOVER); + if (entry->doc == NULL) + { + g_slice_free (AtomEntry, entry); + return NULL; + } root = xmlDocGetRootElement (entry->doc); if (xmlStrcmp (root->name, "entry")) {