Fix a memory leak by freeing ppi.buf in tpm_crb_unrealize.

Signed-off-by: Stefan Berger <[email protected]>
---
 hw/tpm/tpm_crb.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/hw/tpm/tpm_crb.c b/hw/tpm/tpm_crb.c
index 9a9677db6b..4bd1919952 100644
--- a/hw/tpm/tpm_crb.c
+++ b/hw/tpm/tpm_crb.c
@@ -16,6 +16,7 @@
 
 #include "qemu/osdep.h"
 
+#include "qemu/memalign.h"
 #include "qemu/module.h"
 #include "qemu/error-report.h"
 #include "qapi/error.h"
@@ -529,6 +530,8 @@ static void tpm_crb_unrealize(DeviceState *dev)
     if (s->migration_blocker) {
         migrate_del_blocker(&s->migration_blocker);
     }
+
+    qemu_vfree(s->ppi.buf);
 }
 
 static void tpm_crb_class_init(ObjectClass *klass, const void *data)
-- 
2.55.0


Reply via email to