Check strdup for NULL return value.

_xcb_open does not check strdup's return value for NULL if launchd suport
was configured.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Tobias Stoeckmann 2017-03-26 15:41:12 +02:00 committed by Uli Schlachter
parent ee9dfc9a76
commit f830eb93c9

View File

@ -265,6 +265,8 @@ static int _xcb_open(const char *host, char *protocol, const int display)
struct stat sbuf; struct stat sbuf;
if (0 == stat(host, &sbuf)) { if (0 == stat(host, &sbuf)) {
file = strdup(host); file = strdup(host);
if(file == NULL)
return -1;
filelen = actual_filelen = strlen(file); filelen = actual_filelen = strlen(file);
} else } else
#endif #endif