1
0
Fork 0
mirror of https://github.com/pygos/pkg-utils.git synced 2024-11-05 05:07:11 +01:00
pkg-utils/lib/filelist/image_entry.c
David Oberhollenzer 20aea96396 Add license
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-08 18:18:31 +01:00

37 lines
575 B
C

/* SPDX-License-Identifier: ISC */
#include <sys/stat.h>
#include <stdlib.h>
#include <stdio.h>
#include "filelist/image_entry.h"
void image_entry_free(image_entry_t *ent)
{
if (ent != NULL) {
switch (ent->mode & S_IFMT) {
case S_IFREG:
free(ent->data.file.location);
break;
case S_IFLNK:
free(ent->data.symlink.target);
break;
default:
break;
}
free(ent->name);
free(ent);
}
}
void image_entry_free_list(image_entry_t *list)
{
image_entry_t *ent;
while (list != NULL) {
ent = list;
list = list->next;
image_entry_free(ent);
}
}