summary refs log tree commit diff stats
path: root/src/common/tree.c
diff options
context:
space:
mode:
authorRichardHitt <rbh00@netcom.com>2012-10-01 12:53:25 -0700
committerRichardHitt <rbh00@netcom.com>2012-10-01 12:53:25 -0700
commit62903cd171acb49ed66056c32edbcc0fd56b07c5 (patch)
treee57f9e30a86786752f8b8434c9f314ad2e49854f /src/common/tree.c
parent9c3ea364836f52ca4bc980282f22240bfd4c51e5 (diff)
Fix memory leak related to url grabbing
Diffstat (limited to 'src/common/tree.c')
-rw-r--r--src/common/tree.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/common/tree.c b/src/common/tree.c
index 0a459779..33fe1d41 100644
--- a/src/common/tree.c
+++ b/src/common/tree.c
@@ -150,10 +150,11 @@ tree_find (tree *t, void *key, tree_cmp_func *cmp, void *data, int *pos)
 	return mybsearch (key, &t->array[0], t->elements, cmp, data, pos);
 }
 
-void
+void *
 tree_remove_at_pos (tree *t, int pos)
 {
 	int post_bytes;
+	void *ret = t->array[pos];
 
 	t->elements--;
 	if (pos != t->elements)
@@ -161,6 +162,7 @@ tree_remove_at_pos (tree *t, int pos)
 		post_bytes = (t->elements - pos) * sizeof (void *);
 		memmove (&t->array[pos], &t->array[pos + 1], post_bytes);
 	}
+	return ret;
 }
 
 int