]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Initialize tracking variable in structure properly. Fixes a memory leak.
authorTilghman Lesher <tilghman@meg.abyt.es>
Wed, 9 Feb 2011 05:39:39 +0000 (05:39 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Wed, 9 Feb 2011 05:39:39 +0000 (05:39 +0000)
(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

index 04438086e82fc5124b430d997ddd3aafa2d9d1ea..33e3345f100150d9b26603ff1efbf2e6dc4811a3 100644 (file)
@@ -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);