split_string memory leaks cleanedup

This commit is contained in:
taiyu 2015-08-23 19:09:18 -07:00
parent 9a7f48f872
commit c8415d7fef
4 changed files with 11 additions and 7 deletions

View file

@ -42,22 +42,22 @@ char *workspace_next_name(void) {
strcmp(target, "back_and_forth") == 0 ||
strcmp(target, "current") == 0)
{
list_free(args);
free_flat_list(args);
continue;
}
// Make sure that the workspace doesn't already exist
if (workspace_by_name(target)) {
list_free(args);
free_flat_list(args);
continue;
}
list_free(args);
free_flat_list(args);
sway_log(L_DEBUG, "Workspace: Found free name %s", target);
return target;
}
list_free(args);
free_flat_list(args);
}
// As a fall back, get the current number of active workspaces
// and return that + 1 for the next workspace's name