From 7072f6112c29c93596fcd3732f8b2d59204b7ae9 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Sun, 20 May 2018 22:47:07 +1000 Subject: Swaylock: Use calloc instead of malloc --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'main.c') diff --git a/main.c b/main.c index 74a00a3..11b5e8c 100644 --- a/main.c +++ b/main.c @@ -212,7 +212,7 @@ static cairo_surface_t *select_image(struct swaylock_state *state, static void load_image(char *arg, struct swaylock_state *state) { // [:] - struct swaylock_image *image = malloc(sizeof(struct swaylock_image)); + struct swaylock_image *image = calloc(1, sizeof(struct swaylock_image)); char *separator = strchr(arg, ':'); if (separator) { *separator = '\0'; -- cgit v1.2.3