Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com To: cygwin AT cygwin DOT com From: Andrew Schulman Subject: RE: autossh crash with 20050314 and earlier cygwin1.dll [autossh maintainer please note] Date: Wed, 16 Mar 2005 13:59:39 -0500 Lines: 24 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Complaints-To: usenet AT sea DOT gmane DOT org X-Gmane-NNTP-Posting-Host: pcp04399769pcs.nrockv01.md.comcast.net User-Agent: MicroPlanet-Gravity/2.70.2067 X-Archive: encrypt X-Gmane-MailScanner: Found to be clean X-Gmane-MailScanner: Found to be clean X-Gmane-MailScanner-SpamScore: s X-MailScanner-From: goc-cygwin AT m DOT gmane DOT org X-MailScanner-To: cygwin AT cygwin DOT com X-IsSubscribed: yes > Generally speaking, it is whoever mallocs memory that has the > responsibility for freeing it. If your app mallocs it, your app should free > it; if the library mallocs it, the library should free it. > > In some cases, the ownership of a bit of memory (or any other resource) > may be transferred; in those cases, the responsibility for deallocation is > transferred along with the ownership. > > But that does not happen without a clear statement in the interface / > documentation. A function that returns a pointer to some data in memory is > giving you just that, and no more: a pointer to some data in memory. Only > if the specification of the function explicitly states that the caller gets > ownership of the resource should your code assume it has any rights over it > whatsover. If the interface doesn't say so, then you should assume nothing > - not just that you can't free (...) it, but you should also assume that you > aren't allowed to overwrite the memory block or change its contents or do > anything other than examine and/or copy it. OK, thank you. This seems clear. I've sent the patch for this problem upstream, and the corrected Cygwin package will be out shortly. Andrew. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/