From 09d113246c269bf10d3d7bb273a552ac76f7589c Mon Sep 17 00:00:00 2001 From: Sears Russell Date: Fri, 5 Nov 2010 18:59:10 +0000 Subject: [PATCH] fix pointer bug when invoking commit callbacks --- src/stasis/transactionTable.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/stasis/transactionTable.c b/src/stasis/transactionTable.c index 2bb07bc..6062814 100644 --- a/src/stasis/transactionTable.c +++ b/src/stasis/transactionTable.c @@ -134,16 +134,14 @@ int stasis_transaction_table_register_callback(stasis_transaction_table_t *tbl, int *count = &tbl->commitCallbackCount[type]; *list = realloc(*list, (1+*count) * sizeof(*list[0])); - *list[*count] = cb; + (*list)[*count] = cb; for(int i = 0; i < MAX_TRANSACTIONS; i++) { void *** args; args = &tbl->table[i].commitArgs[type]; *args = realloc(*args, (1+*count) * sizeof(*args[0])); - *args[*count] = 0; + (*args)[*count] = 0; } - *count = 1 + *count; - - return 0; + return (*count)++; } int stasis_transaction_table_invoke_callbacks(stasis_transaction_table_t *tbl,