From ca8170a6c37e017ab757eb6ab3bf1361c6420972 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Tue, 9 Oct 2012 09:09:20 +0000 Subject: [PATCH] * libc/posix/wordexp.c (wordexp): Don't leak file streams. --- newlib/ChangeLog | 4 ++++ newlib/libc/posix/wordexp.c | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 6e3348d20..5357d5273 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,7 @@ +2012-10-09 Peter Rosin + + * libc/posix/wordexp.c (wordexp): Don't leak file streams. + 2012-10-03 DJ Delorie * libc/machine/rl78/setjmp.S: Convert from CPP macros to GAS diff --git a/newlib/libc/posix/wordexp.c b/newlib/libc/posix/wordexp.c index bfdb63fd0..a5a97dbdd 100644 --- a/newlib/libc/posix/wordexp.c +++ b/newlib/libc/posix/wordexp.c @@ -143,8 +143,8 @@ wordexp(const char *words, wordexp_t *pwordexp, int flags) pwordexp->we_wordv[pwordexp->we_wordc + offs + i] = NULL; pwordexp->we_wordc += num_words; - close(fd[0]); - close(fd_err[0]); + fclose(f); + fclose(f_err); /* Wait for child to finish. */ waitpid (pid, NULL, 0);