aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominique Martinet <asmadeus@codewreck.org>2018-06-30 10:58:22 +0900
committerDominique Martinet <asmadeus@codewreck.org>2018-06-30 11:38:21 +0900
commitb3313b7f395983482d6efc60db039ef7a97cd6e0 (patch)
tree1557eba0b493969741a4de913e939c6e3d965140
parent399de4d11bb36b71fdfb5f1a06e74cf7c4e6831c (diff)
downloadwlroots-b3313b7f395983482d6efc60db039ef7a97cd6e0.tar.xz
wlr_output: fix scope for 'now'
'when' points to now that was defined in the if, so compiler could reuse that memory area by the time 'when' is called Found through static analysis.
-rw-r--r--types/wlr_output.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/types/wlr_output.c b/types/wlr_output.c
index 40332efd..9f13bef4 100644
--- a/types/wlr_output.c
+++ b/types/wlr_output.c
@@ -486,8 +486,8 @@ bool wlr_output_swap_buffers(struct wlr_output *output, struct timespec *when,
pixman_region32_intersect(&render_damage, &render_damage, damage);
}
+ struct timespec now;
if (when == NULL) {
- struct timespec now;
clock_gettime(CLOCK_MONOTONIC, &now);
when = &now;
}