summaryrefslogtreecommitdiff
path: root/source3/modules/perfcount_test.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2010-02-10 16:23:33 -0800
committerJeremy Allison <jra@samba.org>2010-02-10 16:23:33 -0800
commited0e0a20059aeadddd69c4618d35dfb3aca69ba4 (patch)
treee917d0ed2274a64ed00f49d2ca59f5dfe9288116 /source3/modules/perfcount_test.c
parent91cb7b7c604d6d3c0dcb3dbcdabb0a6db6097035 (diff)
downloadsamba-ed0e0a20059aeadddd69c4618d35dfb3aca69ba4.tar.gz
samba-ed0e0a20059aeadddd69c4618d35dfb3aca69ba4.tar.bz2
samba-ed0e0a20059aeadddd69c4618d35dfb3aca69ba4.zip
Fix bad use when freeing linked list. Todd Stecher (Original author) please check !
Jeremy.
Diffstat (limited to 'source3/modules/perfcount_test.c')
-rw-r--r--source3/modules/perfcount_test.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/source3/modules/perfcount_test.c b/source3/modules/perfcount_test.c
index f9ea817127..67be4aa9c6 100644
--- a/source3/modules/perfcount_test.c
+++ b/source3/modules/perfcount_test.c
@@ -176,12 +176,14 @@ static void perfcount_test_dump_counters(void)
DEBUG(0,("##### Dumping Performance Counters #####\n"));
- for (i=0; i < 256; i++) {
- for (head = g_list[i]; head != NULL; head = head->next) {
- perfcount_test_dump_counter(head, 0);
- SAFE_FREE(DLIST_PREV(head));
- }
- SAFE_FREE(head);
+ for (i=0; i < MAX_OP; i++) {
+ struct perfcount_test_counter *next;
+ for (head = g_list[i]; head != NULL; head = next) {
+ next = head->next;
+ perfcount_test_dump_counter(head, 0);
+ SAFE_FREE(head);
+ }
+ g_list[i] = NULL;
}
}