From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9430 invoked from network); 14 Sep 2008 08:36:32 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 14 Sep 2008 08:36:32 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 55128 invoked from network); 14 Sep 2008 08:36:18 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 14 Sep 2008 08:36:18 -0000 Received: (qmail 25007 invoked by alias); 14 Sep 2008 08:36:10 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 25667 Received: (qmail 24990 invoked from network); 14 Sep 2008 08:36:08 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 14 Sep 2008 08:36:08 -0000 Received: from cork.scru.org (cork.scru.org [209.20.67.2]) by bifrost.dotsrc.org (Postfix) with ESMTPS id 8B4D7802710A for ; Sun, 14 Sep 2008 10:36:03 +0200 (CEST) Received: by cork.scru.org (Postfix, from userid 1000) id 70A8D10409A; Sun, 14 Sep 2008 08:36:01 +0000 (UTC) Date: Sun, 14 Sep 2008 08:36:01 +0000 From: Clint Adams To: zsh-workers@sunsite.dk Subject: PATCH: potential memory leak in bin_compadd Message-ID: <20080914083601.GA23010@scru.org> Mail-Followup-To: zsh-workers@sunsite.dk MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) X-Virus-Scanned: ClamAV 0.92.1/8235/Sun Sep 14 02:29:31 2008 on bifrost X-Virus-Status: Clean mstr might be allocated in an earlier run of the loop, and then not freed on these errors. Index: Src/Zle/complete.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/Zle/complete.c,v retrieving revision 1.40 diff -u -r1.40 complete.c --- Src/Zle/complete.c 8 Jun 2008 17:53:55 -0000 1.40 +++ Src/Zle/complete.c 14 Sep 2008 08:34:16 -0000 @@ -679,10 +679,12 @@ p = "" - 1; } else { zwarnnam(name, "number expected after -%c", *p); + zsfree(mstr); return 1; } if (dat.dummies < 0) { zwarnnam(name, "invalid number: %d", dat.dummies); + zsfree(mstr); return 1; } break; @@ -691,6 +693,7 @@ goto ca_args; default: zwarnnam(name, "bad option: -%c", *p); + zsfree(mstr); return 1; } if (sp) {