Skip to content

Commit

Permalink
filter_expect: release key value (CID 292096)
Browse files Browse the repository at this point in the history
Signed-off-by: Eduardo Silva <[email protected]>
  • Loading branch information
Jonathan Gonzalez V authored and edsiper committed May 11, 2020
1 parent 00eff02 commit 0d37d2c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions plugins/filter_expect/expect.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,6 @@ static int rule_apply(struct flb_expect *ctx, msgpack_object map)
flb_ra_key_value_destroy(val);
return FLB_FALSE;
}
flb_ra_key_value_destroy(val);
}
else if (rule->type == FLB_EXP_KEY_VAL_NOT_NULL) {
if (!val) {
Expand All @@ -351,7 +350,6 @@ static int rule_apply(struct flb_expect *ctx, msgpack_object map)
flb_ra_key_value_destroy(val);
return FLB_FALSE;
}
flb_ra_key_value_destroy(val);
}
else if (rule->type == FLB_EXP_KEY_VAL_EQ) {
if (!val) {
Expand All @@ -378,8 +376,12 @@ static int rule_apply(struct flb_expect *ctx, msgpack_object map)
return FLB_FALSE;
}
}
}

if (val) {
flb_ra_key_value_destroy(val);
}

n++;
}

Expand Down

0 comments on commit 0d37d2c

Please sign in to comment.