[asterisk-commits] eliel: branch eliel/data_retrieval r188020 - /team/eliel/data_retrieval/main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Apr 11 12:27:09 CDT 2009


Author: eliel
Date: Sat Apr 11 12:27:03 2009
New Revision: 188020

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=188020
Log:
- Free the generated node if we are not able to allocate a document structure.
- Put a note to remember to free allocated memory on error.

Modified:
    team/eliel/data_retrieval/main/data.c

Modified: team/eliel/data_retrieval/main/data.c
URL: http://svn.digium.com/svn-view/asterisk/team/eliel/data_retrieval/main/data.c?view=diff&rev=188020&r1=188019&r2=188020
==============================================================================
--- team/eliel/data_retrieval/main/data.c (original)
+++ team/eliel/data_retrieval/main/data.c Sat Apr 11 12:27:03 2009
@@ -397,6 +397,7 @@
 	doc = ast_xml_new();
 	if (!doc) {
 		ast_log(LOG_ERROR, "Unable to create internal data representation structure.\n");
+		ast_xml_free_node(root_node);
 		return NULL;
 	}
 
@@ -450,6 +451,7 @@
 			child = ast_xml_new_node(node_name);
 			if (!child) {
 				ast_log(LOG_ERROR, "Unable to allocate node '%s'\n", node_name);
+				/* XXX: free already allocated memory. */
 				return NULL;
 			}
 			ast_xml_add_child(node, child);




More information about the asterisk-commits mailing list