diff mbox

[PULL,03/11] ahci-test: fix memory leak

Message ID 1452300718-10660-4-git-send-email-jsnow@redhat.com
State New
Headers show

Commit Message

John Snow Jan. 9, 2016, 12:51 a.m. UTC
Use the proper free command to detroy an AHCICommand.

Signed-off-by: John Snow <jsnow@redhat.com>
Message-id: 1452282920-21550-2-git-send-email-jsnow@redhat.com
---
 tests/ahci-test.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/tests/ahci-test.c b/tests/ahci-test.c
index 0888506..f4945dc 100644
--- a/tests/ahci-test.c
+++ b/tests/ahci-test.c
@@ -1045,14 +1045,14 @@  static void test_dma_fragmented(void)
     ahci_command_commit(ahci, cmd, px);
     ahci_command_issue(ahci, cmd);
     ahci_command_verify(ahci, cmd);
-    g_free(cmd);
+    ahci_command_free(cmd);
 
     cmd = ahci_command_create(CMD_READ_DMA);
     ahci_command_adjust(cmd, 0, ptr, bufsize, 32);
     ahci_command_commit(ahci, cmd, px);
     ahci_command_issue(ahci, cmd);
     ahci_command_verify(ahci, cmd);
-    g_free(cmd);
+    ahci_command_free(cmd);
 
     /* Read back the guest's receive buffer into local memory */
     bufread(ptr, rx, bufsize);