Re: [PATCH v3 2/2] read-cache: plug a few leaks
- From
René Scharfe <rene.scharfe@lsrfire.ath.cx>
- Date
- Jun 8, 2013, 15:56 UTC
- Message-ID
- <51B35414.1090101@lsrfire.ath.cx>
- In-Reply-To
- <CAMP44s3K=VtkeCoKqnU9To9YbfO7vph9MsMWtgLWw0n=cYyq5g@mail.gmail.com>
Am 08.06.2013 16:04, schrieb Felipe Contreras:
Show 12 quoted lines
> On Sat, Jun 8, 2013 at 8:22 AM, René Scharfe > <rene.scharfe@lsrfire.ath.cx> wrote: >> Am 08.06.2013 14:15, schrieb Felipe Contreras: > >>> Why leave it out? If somebody makes the mistake of doing the above >>> sequence, would you prefer that we leak? >> >> Leaking is better than silently cleaning up after a buggy caller because it >> still allows the underlying bug to be found. > > No, it doesn't. The pointer is replaced and forever lost. How is > leaking memory helping anyone to find the bug?
Valgrind can tell you where leaked memory was allocated, but not if you free it in the "wrong" place.
René