sway/workspace.c: Cleanup some un-free'd memory

This commit is contained in:
Daniel Lockyer 2016-04-29 23:27:59 +01:00
parent ed8c67e290
commit 0ece17c717

View File

@ -79,12 +79,14 @@ char *workspace_next_name(const char *output_name) {
strcmp(_target, "current") == 0)
{
free(_target);
free(dup);
continue;
}
// Make sure that the workspace doesn't already exist
if (workspace_by_name(_target)) {
free(_target);
free(dup);
continue;
}
@ -92,6 +94,7 @@ char *workspace_next_name(const char *output_name) {
// output
if (!workspace_valid_on_output(output_name, _target)) {
free(_target);
free(dup);
continue;
}
@ -99,6 +102,8 @@ char *workspace_next_name(const char *output_name) {
order = binding->order;
target = _target;
sway_log(L_DEBUG, "Workspace: Found free name %s", _target);
free(dup);
break;
}
}
free(dup);