On Thu, Aug 27, 2009 at 03:43, Johan Herland<johan@xxxxxxxxxxx> wrote: > When allocating a new memory pool, the older pool is leaked, but this is > no worse than the current situation, where (pretty much) all leaf_nodes > are leaked anyway. Could you return the unused nodes back into tghe mempool? By making the pool a preallocated list, perhaps? And then it is trivial to provide a deallocation function for the mempool, which something really concerned about the memleak can call (like when or if libgit get more usable in an application context). > @@ -95,7 +112,6 @@ static struct leaf_node *note_tree_find(struct int_node *tree, unsigned char n, > /* unpack tree and resume search */ > tree->a[i] = NULL; > load_subtree(l, tree, n); > - free(l); free_leaf_node(l), which returns the node into mempool > return note_tree_find(tree, n, key_sha1); > } > break; > @@ -118,7 +134,6 @@ static struct leaf_node *note_tree_find(struct int_node *tree, unsigned char n, > /* unpack tree and resume search */ > tree->a[0] = NULL; > load_subtree(l, tree, n); > - free(l); free_leaf_node(l); > return note_tree_find(tree, n, key_sha1); > } > return NULL; -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html