winedbg: Don't dereference possibly NULL thread pointer.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
(cherry picked from commit 6eff0342ad)
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
This commit is contained in:
Rémi Bernon 2021-03-09 22:54:55 +01:00 committed by Michael Stefaniuc
parent 8d2e4ee83a
commit 7515889470
1 changed files with 2 additions and 2 deletions

View File

@ -111,11 +111,11 @@ struct gdb_context
static void gdbctx_delete_xpoint(struct gdb_context *gdbctx, struct dbg_thread *thread,
dbg_ctx_t *ctx, struct gdb_xpoint *x)
{
struct dbg_process *process = thread->process;
struct dbg_process *process = gdbctx->process;
struct backend_cpu *cpu = process->be_cpu;
if (!cpu->remove_Xpoint(process->handle, process->process_io, ctx, x->type, x->addr, x->value, x->size))
ERR("%04x:%04x: Couldn't remove breakpoint at:%p/%x type:%d\n", process->pid, thread->tid, x->addr, x->size, x->type);
ERR("%04x:%04x: Couldn't remove breakpoint at:%p/%x type:%d\n", process->pid, thread ? thread->tid : ~0, x->addr, x->size, x->type);
list_remove(&x->entry);
HeapFree(GetProcessHeap(), 0, x);