summaryrefslogtreecommitdiffstats
path: root/core/picture.c
blob: 3f887efe8ffc728f2a36eac78985440e687186d7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// SPDX-License-Identifier: GPL-2.0
#include "picture.h"
#include <stdlib.h>
#include <string.h>

struct picture *alloc_picture()
{
	struct picture *pic = malloc(sizeof(struct picture));
	if (!pic)
		exit(1);
	memset(pic, 0, sizeof(struct picture));
	return pic;
}

void free_picture(struct picture *picture)
{
	if (picture) {
		free(picture->filename);
		free(picture);
	}
}