Skip to content

Commit

Permalink
out_s3: fixed potential segfault on file discard
Browse files Browse the repository at this point in the history
In the upload queue logic, if we exceed the acceptable number of upload errors in a row,
we remove the entry from the upload queue. However, instead of immediately moving onto
the next entry, we try to set upload_time. This will cause a segfault. Adding a continue
after removing entry will fix this issue.

Signed-off-by: Stephen Lee <[email protected]>
  • Loading branch information
Stephen Lee authored and PettitWesley committed Jul 26, 2021
1 parent 02adc35 commit 06507a2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions plugins/out_s3/s3.c
Original file line number Diff line number Diff line change
Expand Up @@ -1637,6 +1637,7 @@ static void s3_upload_queue(struct flb_config *config, void *out_context)
s3_store_file_inactive(ctx, upload_contents->upload_file);
multipart_upload_destroy(upload_contents->m_upload_file);
remove_from_queue(upload_contents);
continue;
}

/* Retry in N seconds */
Expand Down

0 comments on commit 06507a2

Please sign in to comment.