]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
libmisc: don't free members variable 383/head
authorIker Pedrosa <ipedrosa@redhat.com>
Wed, 14 Jul 2021 09:59:38 +0000 (11:59 +0200)
committerIker Pedrosa <ipedrosa@redhat.com>
Wed, 14 Jul 2021 10:13:25 +0000 (12:13 +0200)
In 9eb191edc4a625bb68e827b18638f5b5816cb30c I included a free() that
frees the members variable, which in turn causes the comma_to_list()
function to return an array of empty elements. The array variable holds
a list of pointers that point to offsets of the members variable. When
the function succeeds freeing members variable causes the elements of
the array variable to point to an empty string.

This is causing several regressions in our internal testing environment.
So, I'm reverting the change.

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
libmisc/list.c

index d85d5f209ad4018d51f3080b9be3f6be57789a50..8837fa12c9b057e14d721e67b92e0540f8d1362c 100644 (file)
@@ -263,8 +263,6 @@ bool is_on_list (char *const *list, const char *member)
                }
        }
 
-       free (members);
-
        /*
         * Return the new array of pointers
         */