[ovs-dev] [PATCH 2/2] ofp-flow: minimatch is initialized twice.

Yifeng Sun pkusunyifeng at gmail.com
Tue Apr 3 17:12:59 UTC 2018


It is possible that 'fm->match' gets initialized twice in this function,
which makes the first one leak because its pointer is overwritten by the
second initialization.

This patch fixes this issue.

Signed-off-by: Yifeng Sun <pkusunyifeng at gmail.com>
---
 lib/ofp-flow.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/lib/ofp-flow.c b/lib/ofp-flow.c
index d07556245b1f..3744cdbd8079 100644
--- a/lib/ofp-flow.c
+++ b/lib/ofp-flow.c
@@ -272,7 +272,6 @@ ofputil_decode_flow_mod(struct ofputil_flow_mod *fm,
                  * existing cookie. */
                 return OFPERR_NXBRC_NXM_INVALID;
             }
-            minimatch_init(&fm->match, &match);
             fm->priority = ntohs(nfm->priority);
             fm->new_cookie = nfm->cookie;
             fm->idle_timeout = ntohs(nfm->idle_timeout);
-- 
2.7.4



More information about the dev mailing list