Skip to contentSkip to conversation

lib/librte_flow_classify: fix memory leak issue

PATCH Applied Jasvinder Singh 3 participants 3 messages Jan 22, 2018 – Jan 25, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lib/librte_flow_classify: fix memory leak issue

Free allocated memory of the rule if not added to the table.

Fixes 50bdac5916d9 ("flow_classify: remove table id parameter from API")

Coverity issue: 257032

---
 lib/librte_flow_classify/rte_flow_classify.c | 1 +
 1 file changed, 1 insertion(+)
lib/librte_flow_classify/rte_flow_classify.c +1 -0
index 6fa6a74..55492a6 100644
@@ -560,6 +560,7 @@ rte_flow_classify_table_entry_add(struct rte_flow_classifier *cls,
 			return rule;
 		}
 	}
+	free(rule);
 	return NULL;
 }
 
Signature · 1 line
2.9.3
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Jasvinder Singh

Free allocated memory of the rule if not added to the table.

Coverity issue: 257032

Fixes 50bdac5916d9 ("flow_classify: remove table id parameter from API")
Quoted 17 lines
---
 lib/librte_flow_classify/rte_flow_classify.c | 1 +
 1 file changed, 1 insertion(+)
lib/librte_flow_classify/rte_flow_classify.c +1 -0
index 6fa6a74..55492a6 100644
@@ -560,6 +560,7 @@ rte_flow_classify_table_entry_add(struct rte_flow_classifier *cls,
 			return rule;
 		}
 	}
+	free(rule);
 	return NULL;
 }