diff options
| author | Furkan Sahin <furkan-dev@proton.me> | 2018-05-20 22:47:07 +1000 |
|---|---|---|
| committer | Furkan Sahin <furkan-dev@proton.me> | 2018-05-20 22:47:07 +1000 |
| commit | 4d38b821fdd9feff435027c8c746d4aa0ab4c660 (patch) | |
| tree | 9ce53265d014560bf670d2bb9844e4f37e28e60b | |
| parent | faa85871bff33f2f45094f09698b95be67a0a3b4 (diff) | |
Swaylock: Use calloc instead of malloc
| -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, 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'; |
