From 6be4e4d83cd0a48eb59b8fc770e0d7ed4e511145 Mon Sep 17 00:00:00 2001 From: Tilghman Lesher Date: Wed, 9 Feb 2011 05:39:39 +0000 Subject: [PATCH] Initialize tracking variable in structure properly. Fixes a memory leak. (Reported by The_Boy_Wonder on IRC, fixed by me.) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@307142 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- main/lock.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main/lock.c b/main/lock.c index 04438086e8..33e3345f10 100644 --- a/main/lock.c +++ b/main/lock.c @@ -61,7 +61,9 @@ int __ast_pthread_mutex_init(int tracking, const char *filename, int lineno, con #endif /* AST_MUTEX_INIT_W_CONSTRUCTORS */ - ast_reentrancy_init(&t->track); + if ((t->tracking = tracking)) { + ast_reentrancy_init(&t->track); + } #endif /* DEBUG_THREADS */ pthread_mutexattr_init(&attr);