[PATCH 06/10] xfree86: loader: fix memory leaks in LoaderListDirs

Tiago Vignatti tiago.vignatti at nokia.com
Thu Mar 31 05:14:39 PDT 2011


On 03/30/2011 02:46 AM, ext Nicolas PENINGUY wrote:
> On Tue, 2011-03-29 at 18:12 +0300, Tiago Vignatti wrote:
>
>> +++ b/hw/xfree86/loader/loadmod.c
>
>> @@ -556,6 +558,9 @@ LoaderListDirs(const char **subdirlist, const char **patternlist)
>>       }
>>       if (listing)
>>   	listing[n] = NULL;
>> +
>> +    FreeSubdirs(subdirs);
>> +    FreePatterns(patterns);
>>       return listing;
>>   }
>
> Forgot FreePathList(pathlist); ? (And Peter's comment makes sense also)

correct.

We can free pathlist also because it was made a copied to an already 
allocated buffer (strcpy(buf, *elem)).

          Tiago


More information about the xorg-devel mailing list