delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/03/16/14:20:05

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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 <andrex AT alumni DOT utexas DOT net>
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: <MPG.1ca24c222b8768229896d6@localhost>
References: <MPG DOT 1ca23a5849180d8a9896d4 AT localhost> <SERRANOHZomtvWs7uuq0000006e AT SERRANO DOT CAM DOT ARTIMI DOT COM>
Mime-Version: 1.0
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019