commit f35e22bc844373144d6d5248e09e7341c74983c1 parent 35633d45672d14bd798c478c45d1a17064701aa9 Author: Louis Burda <quent.burda@gmail.com> Date: Thu, 28 Sep 2023 02:13:27 +0200 Zero-init lock for memory safety Diffstat:
M | slock.c | | | 2 | +- |
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/slock.c b/slock.c @@ -229,7 +229,7 @@ lockscreen(Display *dpy, struct xrandr *rr, int screen) XSetWindowAttributes wa; Cursor invisible; - if (dpy == NULL || screen < 0 || !(lock = malloc(sizeof(struct lock)))) + if (dpy == NULL || screen < 0 || !(lock = calloc(1, sizeof(struct lock)))) return NULL; lock->screen = screen;