Commit 6a17f583 authored by Junio C Hamano's avatar Junio C Hamano

help.c::exclude_cmds(): plug a leak

Command name removed from the list of commands via the exclusion
were overwritten and lost without being freed.
Signed-off-by: default avatarJunio C Hamano <[email protected]>
parent 4a15758f
......@@ -64,9 +64,10 @@ void exclude_cmds(struct cmdnames *cmds, struct cmdnames *excludes)
cmp = strcmp(cmds->names[ci]->name, excludes->names[ei]->name);
if (cmp < 0)
cmds->names[cj++] = cmds->names[ci++];
else if (cmp == 0)
ci++, ei++;
else if (cmp > 0)
else if (cmp == 0) {
ei++;
free(cmds->names[ci++]);
} else if (cmp > 0)
ei++;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment