[asterisk-commits] eliel: branch group/data_api_gsoc2009 r253534 - /team/group/data_api_gsoc2009...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Mar 19 14:07:54 CDT 2010


Author: eliel
Date: Fri Mar 19 14:07:51 2010
New Revision: 253534

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=253534
Log:
Fix "some" leaks :D

Modified:
    team/group/data_api_gsoc2009/main/data.c

Modified: team/group/data_api_gsoc2009/main/data.c
URL: http://svnview.digium.com/svn/asterisk/team/group/data_api_gsoc2009/main/data.c?view=diff&rev=253534&r1=253533&r2=253534
==============================================================================
--- team/group/data_api_gsoc2009/main/data.c (original)
+++ team/group/data_api_gsoc2009/main/data.c Fri Mar 19 14:07:51 2010
@@ -462,6 +462,7 @@
 		}
 		ao2_ref(node, -1);
 	}
+	ao2_iterator_destroy(&i);
 
 }
 
@@ -1182,6 +1183,7 @@
 			/* the structure member name doesn't match! */
 			ao2_ref(node, -1);
 			ao2_ref(struct_children, -1);
+			ao2_iterator_destroy(&i);
 			return 0;
 		}
 
@@ -1228,6 +1230,7 @@
 
 		ao2_ref(node, -1);
 	}
+	ao2_iterator_destroy(&i);
 
 	ao2_ref(struct_children, -1);
 
@@ -1512,12 +1515,14 @@
 			}
 
 			if (globfound && (i == name_len || orend)) {
+				ao2_iterator_destroy(&iter);
 				return found;
 			}
 		}
 
 		ao2_ref(found, -1);
 	}
+	ao2_iterator_destroy(&iter);
 
 	return NULL;
 }
@@ -1709,6 +1714,7 @@
 
 		ao2_ref(provider, -1);
 	}
+	ao2_iterator_destroy(&i);
 
 	return node;
 }
@@ -1901,6 +1907,8 @@
 
 		ao2_ref(node, -1);
 	}
+	ao2_iterator_destroy(&i);
+
 }
 
 struct ast_xml_doc *ast_data_get_xml(const struct ast_data_query *query)
@@ -2198,6 +2206,8 @@
 	if (iterator->is_pattern) {
 		regfree(&(iterator->regex_pattern));
 	}
+
+	ao2_iterator_destroy(&(iterator->internal_iterator));
 
 	ast_free(iterator);
 	iterator = NULL;
@@ -2425,6 +2435,7 @@
 			data_result_print_cli_node(fd, node, depth + 1);
 			ao2_ref(node, -1);
 		}
+		ao2_iterator_destroy(&iter);
 	} else {
 		data_result_print_cli_node(fd, root, depth);
 	}
@@ -2546,6 +2557,7 @@
 			current_path);
 		ao2_ref(provider, -1);
 	}
+	ao2_iterator_destroy(&i);
 
 	ast_free(current_path);
 }
@@ -2648,6 +2660,7 @@
 
 		ao2_ref(node, -1);
 	}
+	ao2_iterator_destroy(&i);
 
 	ast_free(current_path);
 }




More information about the asterisk-commits mailing list