gpsd-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gpsd-dev] [PATCH 2/2] hacking: mention strdup in the no-malloc sect


From: Eric S. Raymond
Subject: Re: [gpsd-dev] [PATCH 2/2] hacking: mention strdup in the no-malloc section.
Date: Thu, 31 Mar 2016 08:17:16 -0400
User-agent: Mutt/1.5.23 (2014-03-12)

Sanjeev Gupta <address@hidden>:
> On Thu, Mar 31, 2016 at 6:30 AM, Fred Wright <address@hidden> wrote:
> 
> > One way to look at it is that the problem isn't malloc() - it's free().
> 
> 
> So, let us allow use of malloc(), just ban free() ?

Oh ghods no.  We'd get memory leaks for sure.

No, the right thing to do is ban any function that requires a following
free() to deallocate the storage it allocates.
-- 
                <a href="http://www.catb.org/~esr/";>Eric S. Raymond</a>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]