[Xcb] [PATCH 2/2] xcb_connect_to_display_with_auth_info: Fix memory leak

Peter Harris pharris at opentext.com
Fri Jun 11 06:20:49 PDT 2010


On 2010-06-11 09:13, Pauli Nieminen wrote:
> protocol and host are allocated in _xcb_parse_display but ownership of
> them is passed to the caller. They have to be freed in
> xcb_connect_to_display_with_auth_info.

Thanks for the patches.

>  
> +out:
> +    free(host);
> +    free(protocol);
>      return c;
>  }

You need to initialize host and protocol to NULL, otherwise these could
be freeing wild pointers (eg. if name is NULL and $DISPLAY is unset).

Peter Harris
-- 
               Open Text Connectivity Solutions Group
Peter Harris                    http://connectivity.opentext.com/
Research and Development        Phone: +1 905 762 6001
pharris at opentext.com            Toll Free: 1 877 359 4866


More information about the Xcb mailing list