Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Message-ID: <3BC59E8F.756A7BF7@rowman.com> Date: Thu, 11 Oct 2001 09:28:47 -0400 From: John Peacock MIME-Version: 1.0 To: cygwin AT cygwin DOT com CC: kris AT mha DOT ca Subject: Re: Perl 5.7.2 (GDB breaks in 1.3.3-2 on certain Win2000 machines ) References: <30BDEE18E474D511BB0A00D0B7BB87AF09294F AT camel DOT mha DOT ca> <20011010153311 DOT A21102 AT redhat DOT com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Christopher Faylor wrote: > > For the curious, the difference in this code that I thought might > solve the problem was setting the ui variable to NULL prior to the > second invocation of NetUserGetInfo. > Not that it is going to affect the bug that much but just setting the ui variable to NULL is a memory leak. According to the MSDN docs: bufptr Pointer to the buffer in which the data set with the level parameter is stored. The returned buffer should be deallocated using the NetApiBufferFree function. Even though it would be unusual that a failed call would allocate anything in ui, it is possible that the malloc happens before the actual call. I would change ui = NULL; to NetApiBufferFree( (LPVOID *)&ui); (if my C coding is not too stale). HTH John -- John Peacock Director of Information Research and Technology Rowman & Littlefield Publishing Group 4720 Boston Way Lanham, MD 20706 301-459-3366 x.5010 fax 301-429-5747 -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/