Return-Path: X-Original-To: rt-comment@krbdev.mit.edu Received: from mail-out4.apple.com (mail-out4.apple.com [17.254.13.23]) by krbdev.mit.edu (Postfix) with ESMTP id 5E9175C265 for ; Fri, 23 Jan 2009 00:21:49 +0000 (UTC) Received: from relay11.apple.com (relay11.apple.com [17.128.113.48]) by mail-out4.apple.com (Postfix) with ESMTP id C49704FE3558 for ; Thu, 22 Jan 2009 16:21:47 -0800 (PST) Received: from relay11.apple.com (unknown [127.0.0.1]) by relay11.apple.com (Symantec Brightmail Gateway) with ESMTP id AB14928084 for ; Thu, 22 Jan 2009 16:21:47 -0800 (PST) X-Auditid: 11807130-ac899bb000000fcd-eb-49790d9b0a06 Received: from gertie.apple.com (gertie.apple.com [17.151.62.15]) by relay11.apple.com (Apple SCV relay) with ESMTP id 8C92E28081 for ; Thu, 22 Jan 2009 16:21:47 -0800 (PST) MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Received: from hummel.apple.com ([17.202.43.223]) by gertie.apple.com (Sun Java(tm) System Messaging Server 6.3-7.04 (built Sep 26 2008; 32bit)) with ESMTPSA id <0KDW00FOTECB1E60@gertie.apple.com> for rt-comment@krbdev.mit.edu; Thu, 22 Jan 2009 16:21:47 -0800 (PST) Message-ID: From: Love H?rnquist ?strand To: Zhanna Tsitkova via RT In-Reply-To: Subject: Re: [krbdev.mit.edu #6284] memory leaks in error conditions Date: Thu, 22 Jan 2009 16:21:47 -0800 References: X-Mailer: Apple Mail (2.930.3) X-Brightmail-Tracker: AAAAAA== RT-Send-Cc: X-RT-Original-Encoding: us-ascii Content-Length: 863 22 jan 2009 kl. 11.10 skrev Greg Hudson via RT: > First patch looks fine; I adapted it to the current code (which was > changed fairly heavily by Luke) and will commit shortly. > > I don't understand the second patch. The first hunk appears to be for > Apple-specific code, so I'm ignoring that. The other hunks move a > free(reply.enc_part.ciphertext.data) into the errorout label. But (a) > that move seems unnecessary, since in the old location the data was > freed immediately after it was allocated (i.e. on successful return > from > krb5_encode_kdc_rep), and (b) that move seems incorrect, since "goto > errout" can happen in cases where reply.enc_part.ciphertext.data > hasn't > been initialized. There needs to be an if(reply.enc_part.ciphertext.data) protecting. The reason we need this is that the pws case add an extra goto errout; Love