summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Dwyer <ryandwyer1@gmail.com>2018-05-20 22:47:07 +1000
committerRyan Dwyer <ryandwyer1@gmail.com>2018-05-20 22:54:09 +1000
commit7072f6112c29c93596fcd3732f8b2d59204b7ae9 (patch)
tree815a4c5c3a6923397c637e4eeb2c531be7d47750
parent9a06de63e7dc3e2953239d8e7012b1ec499c4ba1 (diff)
Swaylock: Use calloc instead of malloc
-rw-r--r--main.c2
1 files changed, 1 insertions, 1 deletions
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) {
// [<output>:]<path>
- 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';