Merged revisions 339089 via svnmerge from
authorAlexandr Anikin <may@telecom-service.ru>
Mon, 3 Oct 2011 19:16:19 +0000 (19:16 +0000)
committerAlexandr Anikin <may@telecom-service.ru>
Mon, 3 Oct 2011 19:16:19 +0000 (19:16 +0000)
https://origsvn.digium.com/svn/asterisk/branches/10

................
  r339089 | may | 2011-10-03 22:52:55 +0400 (Mon, 03 Oct 2011) | 10 lines

  Merged revisions 339087 via svnmerge from
  https://origsvn.digium.com/svn/asterisk/branches/1.8

  ........
    r339087 | may | 2011-10-03 22:42:49 +0400 (Mon, 03 Oct 2011) | 4 lines

    destroy memheap mutex properly before memheap deleted
    (fix memory leak occured after r304950 changes with DEBUG_THREAD compile option)
  ........
................

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@339091 65c4cc65-6c06-0410-ace0-fbb531ad65f3

addons/ooh323c/src/memheap.c

index 99ed06b..0515ff9 100644 (file)
@@ -1078,9 +1078,10 @@ void memHeapRelease (void** ppvMemHeap)
          free (pMemLink2);
       }
 
-      if ((*ppMemHeap)->flags & RT_MH_FREEHEAPDESC)
+      if ((*ppMemHeap)->flags & RT_MH_FREEHEAPDESC) {
+         ast_mutex_destroy(&pMemHeap->pLock);
          free (*ppMemHeap);
-
+      }
       *ppMemHeap = 0;
    }
 }