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

This commit is contained in:
Guillaume 2024-09-28 08:10:46 +00:00
parent 8a60361949
commit a2d029388c

View file

@ -235,7 +235,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;
}