Merged revisions 339089 via svnmerge from
[asterisk/asterisk.git] / addons / ooh323c / src / memheap.c
index d60b7a0..0515ff9 100644 (file)
@@ -13,8 +13,8 @@
  * maintain this copyright notice.
  *
  *****************************************************************************/
-#include <asterisk.h>
-#include <asterisk/lock.h>
+#include "asterisk.h"
+#include "asterisk/lock.h"
 #include <stdlib.h>
 #include "memheap.h"
 
@@ -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;
    }
 }