mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-21 12:30:06 +00:00
stdio-common: Fix memory leak in tst-freopen4* tests on UNSUPPORTED
The temp_dir allocation leaks if support_can_chroot returns false.
This commit is contained in:
parent
b300078d97
commit
6948ee4edf
@ -33,7 +33,7 @@ int
|
|||||||
do_test (void)
|
do_test (void)
|
||||||
{
|
{
|
||||||
mtrace ();
|
mtrace ();
|
||||||
char *temp_dir = support_create_temp_directory ("tst-freopen4");
|
char *temp_dir;
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
@ -45,6 +45,8 @@ do_test (void)
|
|||||||
support_become_root ();
|
support_become_root ();
|
||||||
if (!support_can_chroot ())
|
if (!support_can_chroot ())
|
||||||
return EXIT_UNSUPPORTED;
|
return EXIT_UNSUPPORTED;
|
||||||
|
|
||||||
|
temp_dir = support_create_temp_directory ("tst-freopen4");
|
||||||
xchroot (temp_dir);
|
xchroot (temp_dir);
|
||||||
|
|
||||||
/* Test freopen with NULL, renamed file. This verifies that
|
/* Test freopen with NULL, renamed file. This verifies that
|
||||||
|
Loading…
Reference in New Issue
Block a user