diff --git a/libselinux/src/label_file.c b/libselinux/src/label_file.c index 5043f09d..b5e904f9 100644 --- a/libselinux/src/label_file.c +++ b/libselinux/src/label_file.c @@ -299,6 +299,8 @@ static int process_line(struct selabel_handle *rec, COMPAT_LOG(SELINUX_WARNING, "%s: line %d is missing fields, skipping\n", path, lineno); + if (items == 1) + free(regex); return 0; } else if (items == 2) { /* The type field is optional. */