This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: avoiding realloc leaks: p = realloc (p, ...


I wrote the following, but it triggered a bounce because
of something in the body of the original message.  So I'm resending,
but without all of the output from the command below, hoping this
will appease the small gods...
I've also just sent a message to the global-allow-... address, as
the bounce notification suggested.

> libc contains some uses of realloc that have this form
>
>   p = realloc (p, ...
>
> so when realloc fails, that probably leaks whatever p was pointing to.
> Here are some that are easily identified -- not including the one in
> misc/error.c for which I just submitted a patch.
> Of course, to find those where the search string is not all on one line,
> you'd have to do more work.
> [obviously, the ones in xmalloc. and tst-*.c don't matter as much]
>
> $ grep -Rw realloc .|grep -E '\b([^ ]+) = realloc \(\1,'


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]