dthelp/htag/malloc: coverity CID 86955; use after free
authorJon Trulson <jon@radscan.com>
Sat, 31 Mar 2018 23:52:27 +0000 (17:52 -0600)
committerJon Trulson <jon@radscan.com>
Sat, 31 Mar 2018 23:52:27 +0000 (17:52 -0600)
cde/programs/dthelp/parser.ccdf/htag/util/malloc.c

index 820128288e8c05adecde1fe17042cf4aec7d3202..416f28bac742b5da66c7e6097b549aeaf3afa00b 100644 (file)
@@ -93,7 +93,6 @@ void m_free(block, msg)
 #if defined(MSDOS)
     if (m_heapchk) m_heapdump() ;
 #endif
-    free(block) ;
     if (m_malftrace) {
 #if defined(hpux) || defined(_AIX) || defined(sun) || defined(USL) || defined(__uxp__)
       sprintf(buffer, "%5x:%5x",
@@ -107,6 +106,7 @@ void m_free(block, msg)
       m_trace(msg) ;
       m_trace("\n") ;
       }      
+    free(block) ;
 #if defined(MSDOS)
     if (m_heapchk) m_heapdump() ;
 #endif