Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

record_accesor: fix return value for flb_ra_get_kv_pair when get_ra_parser fails. #10105

Merged
merged 1 commit into from
Mar 20, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/flb_record_accessor.c
Original file line number Diff line number Diff line change
Expand Up @@ -755,8 +755,8 @@ static struct flb_ra_parser* get_ra_parser(struct flb_record_accessor *ra)
* If 'record accessor' pattern matches an entry in the 'map', set the
* reference in 'out_key' and 'out_val' for the entries in question.
*
* Returns FLB_TRUE if the pattern matched a kv pair, otherwise it returns
* FLB_FALSE.
* Returns 0 if the pattern matched a kv pair, otherwise it returns
* -1.
*/
int flb_ra_get_kv_pair(struct flb_record_accessor *ra, msgpack_object map,
msgpack_object **start_key,
Expand All @@ -766,7 +766,7 @@ int flb_ra_get_kv_pair(struct flb_record_accessor *ra, msgpack_object map,

rp = get_ra_parser(ra);
if (rp == NULL) {
return FLB_FALSE;
return -1;
}

return flb_ra_key_value_get(rp->key->name, map, rp->key->subkeys,
Expand Down
Loading