summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Stoeckmann <tobias@stoeckmann.org>2017-03-26 15:41:12 +0200
committerUli Schlachter <psychon@znc.in>2017-04-01 11:50:09 +0200
commitf830eb93c9c38b2c6c7ea2971af3bc6a61e92277 (patch)
treeee16df4168bbc35923be84842c2a86e668f9d3e3
parentee9dfc9a7658e7fe75d27483bb5ed1ba4d1e2c86 (diff)
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>
-rw-r--r--src/xcb_util.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/xcb_util.c b/src/xcb_util.c
index a3357ef..a16270c 100644
--- a/src/xcb_util.c
+++ b/src/xcb_util.c
@@ -265,6 +265,8 @@ static int _xcb_open(const char *host, char *protocol, const int display)
struct stat sbuf;
if (0 == stat(host, &sbuf)) {
file = strdup(host);
+ if(file == NULL)
+ return -1;
filelen = actual_filelen = strlen(file);
} else
#endif