zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: <zsh-workers@zsh.org>
Subject: Re: PATCH (differently) Re: PATCH: Plug some fd leaks in bin_print
Date: Tue, 06 Jan 2015 23:14:54 -0800	[thread overview]
Message-ID: <150106231454.ZM26126@torch.brasslantern.com> (raw)
In-Reply-To: <150106230807.ZM13656@torch.brasslantern.com>

On Jan 6, 11:08pm, Bart Schaefer wrote:
}
} Does coverity still find leaks after this?  What I've done is to move
} option validity checking earlier in the function so that fout should
} never get opened in the first place if we're not going to make proper
} use of it later.

Oops, forgot to delete a couple of lines from a copy-paste:

} +	if (fmt && !*args) {
} +	    if (fout != stdout)
} +	        fclose(fout);
} +	    return 0;
} +	}

fout is always stdout there, so that can just be

+	if (fmt && !*args)
+	    return 0;

I won't resend the entire diff unless somebody needs it.


  reply	other threads:[~2015-01-07  7:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-07  0:25 Mikael Magnusson
2015-01-07  1:21 ` Bart Schaefer
2015-01-07  3:15   ` Mikael Magnusson
2015-01-07  6:35 ` Bart Schaefer
2015-01-07  7:08   ` PATCH (differently) " Bart Schaefer
2015-01-07  7:14     ` Bart Schaefer [this message]
2015-01-07  8:26       ` Mikael Magnusson
2015-01-07 17:04         ` Bart Schaefer
2015-01-07  8:04   ` Mikael Magnusson
2015-01-07  8:06     ` Mikael Magnusson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=150106231454.ZM26126@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).