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:
Chris Wilson 2013-10-09 16:22:59 +01:00
parent 6fda305e2f
commit d1aa2ac5dd
1 changed files with 2 additions and 1 deletions

View File

@ -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);
}