zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: memory leak / file handle left open in bin_print
@ 2008-10-18 14:04 Clint Adams
  0 siblings, 0 replies; only message in thread
From: Clint Adams @ 2008-10-18 14:04 UTC (permalink / raw)
  To: zsh-workers

Index: Src/builtin.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/builtin.c,v
retrieving revision 1.212
diff -u -r1.212 builtin.c
--- Src/builtin.c	14 Oct 2008 21:47:52 -0000	1.212
+++ Src/builtin.c	18 Oct 2008 14:00:57 -0000
@@ -3689,8 +3689,11 @@
     if (OPT_ISSET(ops,'o') || OPT_ISSET(ops,'O')) {
 	int flags;
 
-	if (fmt && !*args)
+	if (fmt && !*args) {
+	    if (fout != stdout)
+	        fclose(fout);
 	    return 0;
+	}
 	flags = OPT_ISSET(ops,'i') ? SORTIT_IGNORING_CASE : 0;
 	if (OPT_ISSET(ops,'O'))
 	    flags |= SORTIT_BACKWARDS;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-10-18 14:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-18 14:04 PATCH: memory leak / file handle left open in bin_print Clint Adams

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).