mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-30 22:05:27 +00:00
Remove unused and broken dup_value_list function
This function was broken all this time: instead of duplicating each entry in the list, it would duplicate the first entry n times. Since this function is currently not used anywhere, delete it instead of fixing it. Signed-off-by: Ryan Lee <ryan.lee@canonical.com>
This commit is contained in:
@@ -1196,37 +1196,6 @@ void free_value_list(struct value_list *list)
|
||||
}
|
||||
}
|
||||
|
||||
struct value_list *dup_value_list(struct value_list *list)
|
||||
{
|
||||
struct value_list *entry, *dup, *head = NULL;
|
||||
char *value;
|
||||
|
||||
list_for_each(list, entry) {
|
||||
value = NULL;
|
||||
if (list->value) {
|
||||
value = strdup(list->value);
|
||||
if (!value)
|
||||
goto fail2;
|
||||
}
|
||||
dup = new_value_list(value);
|
||||
if (!dup)
|
||||
goto fail;
|
||||
if (head)
|
||||
list_append(head, dup);
|
||||
else
|
||||
head = dup;
|
||||
}
|
||||
|
||||
return head;
|
||||
|
||||
fail:
|
||||
free(value);
|
||||
fail2:
|
||||
free_value_list(head);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void print_value_list(struct value_list *list)
|
||||
{
|
||||
struct value_list *entry;
|
||||
|
Reference in New Issue
Block a user