diff options
| author | Furkan Sahin <furkan-dev@proton.me> | 2019-02-05 08:35:00 -0500 |
|---|---|---|
| committer | Furkan Sahin <furkan-dev@proton.me> | 2019-02-05 08:35:00 -0500 |
| commit | dced18a07d236ec0cf762cd64899149b4c379994 (patch) | |
| tree | bc3ed187e304d0bd2fa76d4bb2a8a6ef2a38cb08 | |
| parent | cd9c82a016d637680ab31c1809d31ca37884f250 (diff) | |
cmd_workspace_gaps: fix double free on bad amount
This fixes a double free in cmd_workspace_gaps when the amount given is
invalid. The end pointer from strtol is part of the argument and should
not be freed. Freeing the end pointer could result in a double free or
bad free depending on whether or not the end pointer was at the start of
the argument
| -rw-r--r-- | sway/commands/workspace.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/sway/commands/workspace.c b/sway/commands/workspace.c index c5d6435a..65a3f407 100644 --- a/sway/commands/workspace.c +++ b/sway/commands/workspace.c @@ -76,7 +76,6 @@ static struct cmd_results *cmd_workspace_gaps(int argc, char **argv, char *end; int amount = strtol(argv[gaps_location + 2], &end, 10); if (strlen(end)) { - free(end); return cmd_results_new(CMD_FAILURE, expected); } |
