fix a segfault in sandbox.c if handle->dlcb is null

(cherry picked from commit a2d029388c)
This commit is contained in:
Guillaume 2024-09-28 08:10:46 +00:00 committed by Allan McRae
parent e3aedfb7aa
commit c685ae6412

View file

@ -222,7 +222,9 @@ bool _alpm_sandbox_process_cb_download(alpm_handle_t *handle, int callback_pipe)
ASSERT(read_from_pipe(callback_pipe, filename, filename_size) != -1, FREE(filename); return false);
filename[filename_size] = '\0';
handle->dlcb(handle->dlcb_ctx, filename, type, &cb_data);
if(handle->dlcb) {
handle->dlcb(handle->dlcb_ctx, filename, type, &cb_data);
}
FREE(filename);
return true;
}