There is a memory leak in OPLCreate(),Should free allocated mem
before return.

Signed-off-by: Jidong Xia <xiajid...@cmss.chinamobile.com>
---
 hw/audio/fmopl.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/audio/fmopl.c b/hw/audio/fmopl.c
index 9f50a89..ca9825b 100644
--- a/hw/audio/fmopl.c
+++ b/hw/audio/fmopl.c
@@ -1112,6 +1112,7 @@ FM_OPL *OPLCreate(int clock, int rate)
                opl_dbg_maxchip++;
        }
 #endif
+       free(ptr);
        return OPL;
 }
 
-- 
1.8.3.1




Reply via email to