This is the mail archive of the libc-alpha@sourceware.org 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: [PATCH 1/2] openpty: close slave pty fd on error


On 08/26/2017 03:44 PM, Christian Brauner wrote:
>   fail:
>    close (master);
> +  if (slave != -1)
> +    close(slave);
>    return -1;

This is inconsistent with how the code frees buf if there is an error:
For buf, the free operation happens before the fail tail.  I think we
should keep this consistent: either free exactly what is needed, or have
a single function exit which checks for initialization and frees what
has been allocated.

Thanks,
Florian


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