Skip to content

Commit

Permalink
tm: more debug info when freeing a transaction
Browse files Browse the repository at this point in the history
- attempt to catch a double free
  • Loading branch information
miconda committed Sep 23, 2015
1 parent ca61f78 commit ef44e5b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion modules/tm/h_table.c
Expand Up @@ -115,14 +115,16 @@ unsigned int transaction_count( void )



void free_cell( struct cell* dead_cell )
void free_cell_helper( struct cell* dead_cell, const char *fname, unsigned int fline )
{
char *b;
int i;
struct sip_msg *rpl;
struct totag_elem *tt, *foo;
struct tm_callback *cbs, *cbs_tmp;

LM_WARN("===== freeing transaction %p from %s:%u\n", dead_cell, fname, fline);

release_cell_lock( dead_cell );
if (unlikely(has_tran_tmcbs(dead_cell, TMCB_DESTROY)))
run_trans_callbacks(TMCB_DESTROY, dead_cell, 0, 0, 0);
Expand Down
5 changes: 4 additions & 1 deletion modules/tm/h_table.h
Expand Up @@ -552,7 +552,10 @@ struct s_table* tm_get_table(void);

struct s_table* init_hash_table(void);
void free_hash_table(void);
void free_cell( struct cell* dead_cell );

void free_cell_helper( struct cell* dead_cell, const char *fname, unsigned int fline);
#define free_cell(t) free_cell_helper((t), __FILE__, __LINE__)

struct cell* build_cell( struct sip_msg* p_msg );

#ifdef TM_HASH_STATS
Expand Down

0 comments on commit ef44e5b

Please sign in to comment.