From f35e22bc844373144d6d5248e09e7341c74983c1 Mon Sep 17 00:00:00 2001 From: Louis Burda Date: Thu, 28 Sep 2023 02:13:27 +0200 Subject: Zero-init lock for memory safety --- slock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slock.c b/slock.c index 5ae738c..6c3401f 100644 --- 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; -- cgit v1.2.3-71-gd317