mirror of
https://github.com/swaywm/sway.git
synced 2024-12-28 07:56:31 +01:00
Swaylock: Use calloc instead of malloc
This commit is contained in:
parent
bde9711f3c
commit
8361233295
1 changed files with 1 additions and 1 deletions
|
@ -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';
|
||||
|
|
Loading…
Reference in a new issue