Re: [PATCH] Free the results of scandir()

Subject: Re: [PATCH] Free the results of scandir()

Date: Tue, 07 Feb 2012 12:30:12 +0200

To: Ethan Glasser-Camp, notmuch@notmuchmail.org

Cc: Ethan Glasser-Camp

From: Tomi Ollila


On Tue,  7 Feb 2012 05:05:03 -0500, Ethan Glasser-Camp <glasse@cs.rpi.edu> wrote:
> From: Ethan Glasser-Camp <ethan@betacantrips.com>
> 
> scandir() returns "strings allocated via malloc(3)" which are then
> "collected in array namelist which is allocated via
> malloc(3)". Currently we just free the array namelist. Instead, free
> all the entries of namelist, and then free namelist.
> 
> entry only points to elements of namelist, so we don't free it
> separately.
> ---

+1

Tomi
part-000.sig (application/pgp-signature)

Thread: