summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitri Pal <dpal@redhat.com>2010-06-19 11:19:45 -0400
committerStephen Gallagher <sgallagh@redhat.com>2010-06-28 08:38:14 -0400
commit3e4f712b7c6009a654757f9900d7b1e0ffc2a6d3 (patch)
tree81720edde2f898d3a09b67b1f2a928ffb006bec1
parentb0249a8990feeb7e7b49da59fb1337a5f462bc64 (diff)
downloadsssd-3e4f712b7c6009a654757f9900d7b1e0ffc2a6d3.tar.gz
sssd-3e4f712b7c6009a654757f9900d7b1e0ffc2a6d3.tar.bz2
sssd-3e4f712b7c6009a654757f9900d7b1e0ffc2a6d3.zip
Fixing memory leaks in the unit test.
-rw-r--r--common/collection/collection_queue_ut.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/common/collection/collection_queue_ut.c b/common/collection/collection_queue_ut.c
index 1d143228..fbe6ea38 100644
--- a/common/collection/collection_queue_ut.c
+++ b/common/collection/collection_queue_ut.c
@@ -137,12 +137,14 @@ int empty_test(void)
col_destroy_collection(queue);
return error;
}
+
+ col_delete_item(item);
+
COLOUT(col_debug_collection(queue,COL_TRAVERSE_DEFAULT));
}
- COLOUT(printf("Add elemebts again.\n"));
- if((error = col_create_queue(&queue)) ||
- (error = col_enqueue_str_property(queue, "item1","value 1" ,0)) ||
+ COLOUT(printf("Add elements again.\n"));
+ if((error = col_enqueue_str_property(queue, "item1","value 1" ,0)) ||
(error = col_enqueue_int_property(queue, "item2", -1)) ||
(error = col_enqueue_unsigned_property(queue, "item3", 1))) {
printf("Failed to enqueue property. Error %d\n", error);
@@ -169,10 +171,14 @@ int empty_test(void)
col_destroy_collection(queue);
return error;
}
+
+ col_delete_item(item);
+
COLOUT(col_debug_collection(queue,COL_TRAVERSE_DEFAULT));
}
col_destroy_collection(queue);
+
TRACE_FLOW_NUMBER("empty_test. Returning", error);
COLOUT(printf("\n\nEND OF QUEUE TEST!!!.\n\n\n"));