diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-10-09 16:22:59 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-10-09 16:22:59 +0100 |
commit | d1aa2ac5dddf6b8c8c1333aae415abda9ad72d85 (patch) | |
tree | 6f4d8f09bf2dc2fa1570b5da5cce50b0c0286142 | |
parent | 6fda305e2f2f991b39d09e67d0b17c8c3d50f9a4 (diff) |
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>
-rw-r--r-- | src/sna/sna_display.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c index e893bcd7..71c4c605 100644 --- a/src/sna/sna_display.c +++ b/src/sna/sna_display.c @@ -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); } |