aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2011-02-09 05:39:39 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2011-02-09 05:39:39 +0000
commit9b3d489b5beac36d984dde153bcea874167f0865 (patch)
tree85a7f4229a21ed03a63b68f08621cf9daf1ac7d7 /main
parent0460c2e751e26c507079f2648fbd0bc88af31233 (diff)
Initialize tracking variable in structure properly. Fixes a memory leak.
(Reported by The_Boy_Wonder on IRC, fixed by me.) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.8@307142 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r--main/lock.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/main/lock.c b/main/lock.c
index 04438086e..33e3345f1 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);