mirror of
https://github.com/swaywm/sway.git
synced 2024-11-11 04:54:14 +01:00
Merge pull request #616 from neosilky/memleak
sway/workspace.c: Cleanup some un-free'd memory
This commit is contained in:
commit
75aa3b1be4
@ -79,12 +79,14 @@ char *workspace_next_name(const char *output_name) {
|
|||||||
strcmp(_target, "current") == 0)
|
strcmp(_target, "current") == 0)
|
||||||
{
|
{
|
||||||
free(_target);
|
free(_target);
|
||||||
|
free(dup);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make sure that the workspace doesn't already exist
|
// Make sure that the workspace doesn't already exist
|
||||||
if (workspace_by_name(_target)) {
|
if (workspace_by_name(_target)) {
|
||||||
free(_target);
|
free(_target);
|
||||||
|
free(dup);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -92,6 +94,7 @@ char *workspace_next_name(const char *output_name) {
|
|||||||
// output
|
// output
|
||||||
if (!workspace_valid_on_output(output_name, _target)) {
|
if (!workspace_valid_on_output(output_name, _target)) {
|
||||||
free(_target);
|
free(_target);
|
||||||
|
free(dup);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -99,6 +102,8 @@ char *workspace_next_name(const char *output_name) {
|
|||||||
order = binding->order;
|
order = binding->order;
|
||||||
target = _target;
|
target = _target;
|
||||||
sway_log(L_DEBUG, "Workspace: Found free name %s", _target);
|
sway_log(L_DEBUG, "Workspace: Found free name %s", _target);
|
||||||
|
free(dup);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
free(dup);
|
free(dup);
|
||||||
|
Loading…
Reference in New Issue
Block a user