flow_classify: fix memory leak in rule add
authorJasvinder Singh <jasvinder.singh@intel.com>
Mon, 22 Jan 2018 14:14:28 +0000 (14:14 +0000)
committerThomas Monjalon <thomas@monjalon.net>
Thu, 25 Jan 2018 22:26:51 +0000 (23:26 +0100)
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")

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
lib/librte_flow_classify/rte_flow_classify.c

index 6fa6a74..55492a6 100644 (file)
@@ -560,6 +560,7 @@ rte_flow_classify_table_entry_add(struct rte_flow_classifier *cls,
                        return rule;
                }
        }
+       free(rule);
        return NULL;
 }