This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch 1/4] wordexp: dont leak file streams


2012-10-09  Peter Rosin  <peda@lysator.liu.se>

	* libc/posix/wordexp.c (wordexp): Don't leak file streams.

Index: newlib/libc/posix/wordexp.c
===================================================================
--- newlib.orig/libc/posix/wordexp.c
+++ newlib/libc/posix/wordexp.c
@@ -143,8 +143,8 @@ wordexp(const char *words, wordexp_t *pw
       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);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]