[PATCH 02/10] os: fix memory leak in Popen

Tiago Vignatti tiago.vignatti at nokia.com
Thu Mar 31 05:15:41 PDT 2011


On 03/30/2011 02:10 AM, ext Nicolas PENINGUY wrote:
> On Tue, 2011-03-29 at 18:12 +0300, Tiago Vignatti wrote:
>> +++ b/os/utils.c
>> @@ -1315,6 +1315,7 @@ Popen(char *command, char *type)
>>       /* Ignore the smart scheduler while this is going on */
>>       old_alarm = OsSignal(SIGALRM, SIG_IGN);
>>       if (old_alarm == SIG_ERR) {
>> +      free(cur);
>>         perror("signal");
>>         return NULL;
>>       }
>
> Shouldn't we close the two file descriptors returned by pipe() in this
> case ?
>
> close(pdes[0]);
> close(pdes[1]);

yes, we should. Thanks!

    Tiago


More information about the xorg-devel mailing list