diff --git a/drivers/net/softnic/rte_eth_softnic_thread.c b/drivers/net/softnic/rte_eth_softnic_thread.c
index 028911c19..f45dbbe1e 100644
--- a/drivers/net/softnic/rte_eth_softnic_thread.c
+++ b/drivers/net/softnic/rte_eth_softnic_thread.c
@@ -773,9 +773,9 @@ pipeline_msg_alloc(void)
 }
 
 static void
-pipeline_msg_free(struct pipeline_msg_rsp *rsp)
+pipeline_msg_free(void *msg)
 {
-	free(rsp);
+	free(msg);
 }
 
 static struct pipeline_msg_rsp *
@@ -843,8 +843,10 @@ softnic_pipeline_port_in_stats_read(struct pmd_internals *softnic,
 
 	/* Send request and wait for response */
 	rsp = pipeline_msg_send_recv(p, req);
-	if (rsp == NULL)
+	if (rsp == NULL) {
+		pipeline_msg_free(req);
 		return -1;
+	}
 
 	/* Read response */
 	status = rsp->status;
@@ -892,8 +894,10 @@ softnic_pipeline_port_in_enable(struct pmd_internals *softnic,
 
 	/* Send request and wait for response */
 	rsp = pipeline_msg_send_recv(p, req);
-	if (rsp == NULL)
+	if (rsp == NULL) {
+		pipeline_msg_free(req);
 		return -1;
+	}
 
 	/* Read response */
 	status = rsp->status;
@@ -939,8 +943,10 @@ softnic_pipeline_port_in_disable(struct pmd_internals *softnic,
 
 	/* Send request and wait for response */
 	rsp = pipeline_msg_send_recv(p, req);
-	if (rsp == NULL)
+	if (rsp == NULL) {
+		pipeline_msg_free(req);
 		return -1;
+	}
 
 	/* Read response */
 	status = rsp->status;
@@ -994,8 +1000,10 @@ softnic_pipeline_port_out_stats_read(struct pmd_internals *softnic,
 
 	/* Send request and wait for response */
 	rsp = pipeline_msg_send_recv(p, req);
-	if (rsp == NULL)
+	if (rsp == NULL) {
+		pipeline_msg_free(req);
 		return -1;
+	}
 
 	/* Read response */
 	status = rsp->status;
@@ -1051,8 +1059,10 @@ softnic_pipeline_table_stats_read(struct pmd_internals *softnic,
 
 	/* Send request and wait for response */
 	rsp = pipeline_msg_send_recv(p, req);
-	if (rsp == NULL)
+	if (rsp == NULL) {
+		pipeline_msg_free(req);
 		return -1;
+	}
 
 	/* Read response */
 	status = rsp->status;
@@ -1331,8 +1341,10 @@ softnic_pipeline_table_rule_add(struct pmd_internals *softnic,
 
 	/* Send request and wait for response */
 	rsp = pipeline_msg_send_recv(p, req);
-	if (rsp == NULL)
+	if (rsp == NULL) {
+		pipeline_msg_free(req);
 		return -1;
+	}
 
 	/* Read response */
 	status = rsp->status;
@@ -1415,8 +1427,10 @@ softnic_pipeline_table_rule_add_default(struct pmd_internals *softnic,
 
 	/* Send request and wait for response */
 	rsp = pipeline_msg_send_recv(p, req);
-	if (rsp == NULL)
+	if (rsp == NULL) {
+		pipeline_msg_free(req);
 		return -1;
+	}
 
 	/* Read response */
 	status = rsp->status;
@@ -1573,8 +1587,10 @@ softnic_pipeline_table_rule_add_bulk(struct pmd_internals *softnic,
 
 	/* Send request and wait for response */
 	rsp = pipeline_msg_send_recv(p, req);
-	if (rsp == NULL)
+	if (rsp == NULL) {
+		pipeline_msg_free(req);
 		return -1;
+	}
 
 	/* Read response */
 	status = rsp->status;
@@ -1638,8 +1654,10 @@ softnic_pipeline_table_rule_delete(struct pmd_internals *softnic,
 
 	/* Send request and wait for response */
 	rsp = pipeline_msg_send_recv(p, req);
-	if (rsp == NULL)
+	if (rsp == NULL) {
+		pipeline_msg_free(req);
 		return -1;
+	}
 
 	/* Read response */
 	status = rsp->status;
@@ -1688,8 +1706,10 @@ softnic_pipeline_table_rule_delete_default(struct pmd_internals *softnic,
 
 	/* Send request and wait for response */
 	rsp = pipeline_msg_send_recv(p, req);
-	if (rsp == NULL)
+	if (rsp == NULL) {
+		pipeline_msg_free(req);
 		return -1;
+	}
 
 	/* Read response */
 	status = rsp->status;
@@ -1748,8 +1768,10 @@ softnic_pipeline_table_rule_stats_read(struct pmd_internals *softnic,
 
 	/* Send request and wait for response */
 	rsp = pipeline_msg_send_recv(p, req);
-	if (rsp == NULL)
+	if (rsp == NULL) {
+		pipeline_msg_free(req);
 		return -1;
+	}
 
 	/* Read response */
 	status = rsp->status;
@@ -1831,6 +1853,7 @@ softnic_pipeline_table_mtr_profile_add(struct pmd_internals *softnic,
 	rsp = pipeline_msg_send_recv(p, req);
 	if (rsp == NULL) {
 		free(mp);
+		pipeline_msg_free(req);
 		return -1;
 	}
 
@@ -1888,8 +1911,10 @@ softnic_pipeline_table_mtr_profile_delete(struct pmd_internals *softnic,
 
 	/* Send request and wait for response */
 	rsp = pipeline_msg_send_recv(p, req);
-	if (rsp == NULL)
+	if (rsp == NULL) {
+		pipeline_msg_free(req);
 		return -1;
+	}
 
 	/* Read response */
 	status = rsp->status;
@@ -1951,8 +1976,10 @@ softnic_pipeline_table_rule_mtr_read(struct pmd_internals *softnic,
 
 	/* Send request and wait for response */
 	rsp = pipeline_msg_send_recv(p, req);
-	if (rsp == NULL)
+	if (rsp == NULL) {
+		pipeline_msg_free(req);
 		return -1;
+	}
 
 	/* Read response */
 	status = rsp->status;
@@ -2016,8 +2043,10 @@ softnic_pipeline_table_dscp_table_update(struct pmd_internals *softnic,
 
 	/* Send request and wait for response */
 	rsp = pipeline_msg_send_recv(p, req);
-	if (rsp == NULL)
+	if (rsp == NULL) {
+		pipeline_msg_free(req);
 		return -1;
+	}
 
 	/* Read response */
 	status = rsp->status;
@@ -2081,8 +2110,10 @@ softnic_pipeline_table_rule_ttl_read(struct pmd_internals *softnic,
 
 	/* Send request and wait for response */
 	rsp = pipeline_msg_send_recv(p, req);
-	if (rsp == NULL)
+	if (rsp == NULL) {
+		pipeline_msg_free(req);
 		return -1;
+	}
 
 	/* Read response */
 	status = rsp->status;
