mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-06-02 09:31:12 +00:00
oops, re-using freed memory is a nono :/
This commit is contained in:
parent
bb084d5f14
commit
41e07f08a4
2 changed files with 8 additions and 18 deletions
|
@ -592,16 +592,14 @@ Con_CompleteCommandLine (void)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (c + v + a == 1) {
|
if (c + v + a == 1) {
|
||||||
char **l;
|
|
||||||
if (c)
|
if (c)
|
||||||
l = Cmd_CompleteBuildList(s);
|
list[0] = Cmd_CompleteBuildList(s);
|
||||||
else if (v)
|
else if (v)
|
||||||
l = Cvar_CompleteBuildList(s);
|
list[0] = Cvar_CompleteBuildList(s);
|
||||||
else
|
else
|
||||||
l = Cmd_CompleteAliasBuildList(s);
|
list[0] = Cmd_CompleteAliasBuildList(s);
|
||||||
cmd = *l;
|
cmd = *list[0];
|
||||||
cmd_len = strlen (cmd);
|
cmd_len = strlen (cmd);
|
||||||
free (l);
|
|
||||||
} else {
|
} else {
|
||||||
if (c)
|
if (c)
|
||||||
cmd = *(list[0] = Cmd_CompleteBuildList(s));
|
cmd = *(list[0] = Cmd_CompleteBuildList(s));
|
||||||
|
@ -635,19 +633,16 @@ Con_CompleteCommandLine (void)
|
||||||
if (c) {
|
if (c) {
|
||||||
Con_Printf("%i possible command%s\n", c, (c > 1) ? "s: " : ":");
|
Con_Printf("%i possible command%s\n", c, (c > 1) ? "s: " : ":");
|
||||||
Con_DisplayList(list[0], con_linewidth);
|
Con_DisplayList(list[0], con_linewidth);
|
||||||
free(list[0]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (v) {
|
if (v) {
|
||||||
Con_Printf("%i possible variable%s\n", v, (v > 1) ? "s: " : ":");
|
Con_Printf("%i possible variable%s\n", v, (v > 1) ? "s: " : ":");
|
||||||
Con_DisplayList(list[1], con_linewidth);
|
Con_DisplayList(list[1], con_linewidth);
|
||||||
free(list[1]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (a) {
|
if (a) {
|
||||||
Con_Printf("%i possible aliases%s\n", a, (a > 1) ? "s: " : ":");
|
Con_Printf("%i possible aliases%s\n", a, (a > 1) ? "s: " : ":");
|
||||||
Con_DisplayList(list[2], con_linewidth);
|
Con_DisplayList(list[2], con_linewidth);
|
||||||
free(list[2]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -592,16 +592,14 @@ Con_CompleteCommandLine (void)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (c + v + a == 1) {
|
if (c + v + a == 1) {
|
||||||
char **l;
|
|
||||||
if (c)
|
if (c)
|
||||||
l = Cmd_CompleteBuildList(s);
|
list[0] = Cmd_CompleteBuildList(s);
|
||||||
else if (v)
|
else if (v)
|
||||||
l = Cvar_CompleteBuildList(s);
|
list[0] = Cvar_CompleteBuildList(s);
|
||||||
else
|
else
|
||||||
l = Cmd_CompleteAliasBuildList(s);
|
list[0] = Cmd_CompleteAliasBuildList(s);
|
||||||
cmd = *l;
|
cmd = *list[0];
|
||||||
cmd_len = strlen (cmd);
|
cmd_len = strlen (cmd);
|
||||||
free (l);
|
|
||||||
} else {
|
} else {
|
||||||
if (c)
|
if (c)
|
||||||
cmd = *(list[0] = Cmd_CompleteBuildList(s));
|
cmd = *(list[0] = Cmd_CompleteBuildList(s));
|
||||||
|
@ -635,19 +633,16 @@ Con_CompleteCommandLine (void)
|
||||||
if (c) {
|
if (c) {
|
||||||
Con_Printf("%i possible command%s\n", c, (c > 1) ? "s: " : ":");
|
Con_Printf("%i possible command%s\n", c, (c > 1) ? "s: " : ":");
|
||||||
Con_DisplayList(list[0], con_linewidth);
|
Con_DisplayList(list[0], con_linewidth);
|
||||||
free(list[0]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (v) {
|
if (v) {
|
||||||
Con_Printf("%i possible variable%s\n", v, (v > 1) ? "s: " : ":");
|
Con_Printf("%i possible variable%s\n", v, (v > 1) ? "s: " : ":");
|
||||||
Con_DisplayList(list[1], con_linewidth);
|
Con_DisplayList(list[1], con_linewidth);
|
||||||
free(list[1]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (a) {
|
if (a) {
|
||||||
Con_Printf("%i possible aliases%s\n", a, (a > 1) ? "s: " : ":");
|
Con_Printf("%i possible aliases%s\n", a, (a > 1) ? "s: " : ":");
|
||||||
Con_DisplayList(list[2], con_linewidth);
|
Con_DisplayList(list[2], con_linewidth);
|
||||||
free(list[2]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue