[v2,5/8] ipc: fix pdump memleak

Message ID 20190423174334.19612-6-herakliusz.lipiec@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Series ipc: fix possible memleaks |


Context Check Description
ci/checkpatch warning coding style issues
ci/Intel-compilation success Compilation OK

Commit Message

Herakliusz Lipiec April 23, 2019, 5:43 p.m. UTC
  When sending synchronous IPC requests, the caller must free the response 
buffer even if the request returned failure. Fix the code to correctly 
use the IPC API.

Bugzilla ID: 228
Fixes: 660098d61f57 ("pdump: use generic multi-process channel")
Cc: jianfeng.tan@intel.com
Cc: stable@dpdk.org
Signed-off-by: Herakliusz Lipiec <herakliusz.lipiec@intel.com>
Acked-By: Reshma Pattan <reshma.pattan@intel.com>
 lib/librte_pdump/rte_pdump.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


diff --git a/lib/librte_pdump/rte_pdump.c b/lib/librte_pdump/rte_pdump.c
index 14744b9ff..3787c3e32 100644
--- a/lib/librte_pdump/rte_pdump.c
+++ b/lib/librte_pdump/rte_pdump.c
@@ -525,8 +525,8 @@  pdump_prepare_client_request(char *device, uint16_t queue,
 		rte_errno = resp->err_value;
 		if (!resp->err_value)
 			ret = 0;
-		free(mp_reply.msgs);
+	free(mp_reply.msgs);
 	if (ret < 0)