diff options
author | Dominique Martinet <asmadeus@codewreck.org> | 2018-06-30 10:58:22 +0900 |
---|---|---|
committer | Dominique Martinet <asmadeus@codewreck.org> | 2018-06-30 11:38:21 +0900 |
commit | b3313b7f395983482d6efc60db039ef7a97cd6e0 (patch) | |
tree | 1557eba0b493969741a4de913e939c6e3d965140 | |
parent | 399de4d11bb36b71fdfb5f1a06e74cf7c4e6831c (diff) | |
download | wlroots-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.c | 2 |
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; } |