mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-07 06:43:00 +03:00
Avoid -Wuse-after-free in tests [BZ #26779].
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
This commit is contained in:
@@ -39,10 +39,11 @@ check_path (int fd)
|
||||
char file_path[PATH_MAX];
|
||||
ssize_t file_path_length
|
||||
= readlink (proc_fd_path, file_path, sizeof (file_path));
|
||||
free (proc_fd_path);
|
||||
if (file_path_length < 0)
|
||||
FAIL_EXIT1 ("readlink (%s, %p, %zu)", proc_fd_path, file_path,
|
||||
sizeof (file_path));
|
||||
|
||||
free (proc_fd_path);
|
||||
file_path[file_path_length] = '\0';
|
||||
TEST_COMPARE_STRING (file_path, "/dev/null");
|
||||
}
|
||||
|
Reference in New Issue
Block a user