cmdtrace.c: fix segfault when trying to list trace after loading fails

This commit is contained in:
Anonymous 2023-12-06 02:36:14 -05:00
parent 3d984559a1
commit 7ef5fe14bb

View file

@ -1094,8 +1094,9 @@ static int CmdTraceLoad(const char *Cmd) {
CLIParserFree(ctx);
if (gs_trace) {
free(gs_trace);
free(gs_trace); // maybe better to not clobber this until we have successful load?
gs_trace = NULL;
gs_traceLen = 0;
}
size_t len = 0;