sna: Steal the current mode name
Rather than duplicating a string, we can simply transfer ownership from the temporary mode to the mode list. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
6fda305e2f
commit
d1aa2ac5dd
|
|
@ -2112,7 +2112,8 @@ sna_output_get_modes(xf86OutputPtr output)
|
|||
Mode = calloc(1, sizeof(DisplayModeRec));
|
||||
if (Mode) {
|
||||
*Mode = current;
|
||||
Mode->name = strdup(Mode->name);
|
||||
current.name = NULL;
|
||||
|
||||
output->probed_modes =
|
||||
xf86ModesAdd(output->probed_modes, Mode);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue