[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] hw/audio: fix a memory leak in OPLCreate()
From: |
Jidong Xia |
Subject: |
[PATCH] hw/audio: fix a memory leak in OPLCreate() |
Date: |
Wed, 23 Oct 2019 17:53:40 +0800 |
There is a memory leak in OPLCreate(),Should free allocated mem
before return.
Signed-off-by: Jidong Xia <address@hidden>
---
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
- [PATCH] hw/audio: fix a memory leak in OPLCreate(),
Jidong Xia <=