diff mbox

[ovs-dev,v2,06/21] expr: Initialize 'relop' of allocated exprs in crush_and_string().

Message ID 1470672872-19450-7-git-send-email-blp@ovn.org
State Superseded
Headers show

Commit Message

Ben Pfaff Aug. 8, 2016, 4:14 p.m. UTC
Every relop at this point is always EXPR_R_EQ, and therefore it seems that
no code actually examined it, so this doesn't appear to fix an existing
bug, but some code I was working on was affected by the uninitialized
member.

Signed-off-by: Ben Pfaff <blp@ovn.org>
---
 ovn/lib/expr.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox

Patch

diff --git a/ovn/lib/expr.c b/ovn/lib/expr.c
index a28684b..86ea75a 100644
--- a/ovn/lib/expr.c
+++ b/ovn/lib/expr.c
@@ -1802,6 +1802,7 @@  crush_and_string(struct expr *expr, const struct expr_symbol *symbol)
     SSET_FOR_EACH (string, &result) {
         sub = xmalloc(sizeof *sub);
         sub->type = EXPR_T_CMP;
+        sub->cmp.relop = EXPR_R_EQ;
         sub->cmp.symbol = symbol;
         sub->cmp.string = xstrdup(string);
         ovs_list_push_back(&expr->andor, &sub->node);