chunk-trace: call flb_errno before calling anything to avoid clobbering errno.
@@ -170,8 +170,8 @@ struct flb_chunk_trace_context *flb_chunk_trace_context_new(void *trace_input,
ctx = flb_calloc(1, sizeof(struct flb_chunk_trace_context));
if (ctx == NULL) {
- pthread_mutex_unlock(&in->chunk_trace_lock);
flb_errno();
+ pthread_mutex_unlock(&in->chunk_trace_lock);
return NULL;
}
@@ -267,8 +267,8 @@ struct flb_chunk_trace *flb_chunk_trace_new(struct flb_input_chunk *chunk)
trace = flb_calloc(1, sizeof(struct flb_chunk_trace));
if (trace == NULL) {
- pthread_mutex_unlock(&f_ins->chunk_trace_lock);
flb_errno();
+ pthread_mutex_unlock(&f_ins->chunk_trace_lock);
return NULL;
}
