diff options
-rw-r--r-- | swaylock/main.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/swaylock/main.c b/swaylock/main.c index 74a00a35..11b5e8c8 100644 --- a/swaylock/main.c +++ b/swaylock/main.c | |||
@@ -212,7 +212,7 @@ static cairo_surface_t *select_image(struct swaylock_state *state, | |||
212 | 212 | ||
213 | static void load_image(char *arg, struct swaylock_state *state) { | 213 | static void load_image(char *arg, struct swaylock_state *state) { |
214 | // [<output>:]<path> | 214 | // [<output>:]<path> |
215 | struct swaylock_image *image = malloc(sizeof(struct swaylock_image)); | 215 | struct swaylock_image *image = calloc(1, sizeof(struct swaylock_image)); |
216 | char *separator = strchr(arg, ':'); | 216 | char *separator = strchr(arg, ':'); |
217 | if (separator) { | 217 | if (separator) { |
218 | *separator = '\0'; | 218 | *separator = '\0'; |