randr: Fix memleak (#6505)

`sasprintf` always allocates `oname` but it is only conditionally freed.

Note: Found with [bugfinder](https://github.com/stanek-michal/bugfinder)
This commit is contained in:
Orestis Floros 2025-10-07 17:33:07 +02:00 committed by GitHub
parent b3329fbb02
commit 389cf064e6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -660,9 +660,8 @@ static bool randr_query_outputs_15(void) {
struct output_name *output_name = scalloc(1, sizeof(struct output_name));
output_name->name = sstrdup(oname);
SLIST_INSERT_HEAD(&new->names_head, output_name, names);
} else {
free(oname);
}
free(oname);
}
FREE(info);
}