[PATCH xserver 05/10] test: Add a little xinit-like program for starting servers for testing.
Julien Cristau
jcristau at debian.org
Thu Sep 22 14:22:23 UTC 2016
On Thu, Sep 22, 2016 at 11:45:06 +0300, Eric Anholt wrote:
> + asprintf(&displayfd_string, "%d", displayfd);
> + if (!displayfd_string)
> + exit(1);
I think you need to check the return value from asprintf, not
displayfd_string:
When successful, these functions return the number of bytes printed,
just like sprintf(3). If memory allocation wasn't possible, or some
other error occurs, these functions will return -1, and the contents of
strp are undefined.
Cheers,
Julien
More information about the xorg-devel
mailing list