[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: |
Fred Wright |
Subject: |
Re: [gpsd-dev] [PATCH 2/2] hacking: mention strdup in the no-malloc section. |
Date: |
Wed, 30 Mar 2016 15:30:35 -0700 (PDT) |
On Mon, 28 Mar 2016, Eric S. Raymond wrote:
> To avoid having to pedabtically overspecify these edge cases we can say
> that (a) if it requres a mabual free(), we don't use it, and (b) use of other
> malloc callers is considered potentially harmful and has to be explicitly
> approved during review.
One way to look at it is that the problem isn't malloc() - it's free().
In any circumstance where it's reasonable to *intentionally* call malloc()
without free(), then there's no risk of a memory leak. :-) Also, blaming
it on free() covers things like strdup(), which mention needing to free()
the result at some point.
Fred Wright
- [gpsd-dev] [PATCH 1/2] hacking: mention signing off on patches and why it's a good thing., Beat Bolli, 2016/03/28
- [gpsd-dev] [PATCH 2/2] hacking: mention strdup in the no-malloc section., Beat Bolli, 2016/03/28
- Re: [gpsd-dev] [PATCH 2/2] hacking: mention strdup in the no-malloc section., Paul Fertser, 2016/03/28
- Re: [gpsd-dev] [PATCH 2/2] hacking: mention strdup in the no-malloc section., Eric S. Raymond, 2016/03/28
- Re: [gpsd-dev] [PATCH 2/2] hacking: mention strdup in the no-malloc section.,
Fred Wright <=
- Re: [gpsd-dev] [PATCH 2/2] hacking: mention strdup in the no-malloc section., Eric S. Raymond, 2016/03/30
- Re: [gpsd-dev] [PATCH 2/2] hacking: mention strdup in the no-malloc section., Sanjeev Gupta, 2016/03/31
- Re: [gpsd-dev] [PATCH 2/2] hacking: mention strdup in the no-malloc section., Eric S. Raymond, 2016/03/31
- Re: [gpsd-dev] [PATCH 2/2] hacking: mention strdup in the no-malloc section., Paul Fertser, 2016/03/31
- Re: [gpsd-dev] [PATCH 2/2] hacking: mention strdup in the no-malloc section., Sanjeev Gupta, 2016/03/31
Re: [gpsd-dev] [PATCH 1/2] hacking: mention signing off on patches and why it's a good thing., Paul Fertser, 2016/03/28