diff options
author | Julien Cristau <jcristau@debian.org> | 2009-02-17 15:23:40 +0100 |
---|---|---|
committer | Julien Cristau <jcristau@debian.org> | 2009-02-17 15:24:43 +0100 |
commit | 990e71361d1d7b79bf07b1dc93e4e905d4f1bdaf (patch) | |
tree | 70f2af87ab5f33cfcde0ed3c4c20715cb9a1aefe | |
parent | b4b5893f69419ff577bbaa4d18f78e4ffd729a0c (diff) |
Check Xmalloc return value in _XConnectXCB
X.Org bug#19137 <http://bugs.freedesktop.org/show_bug.cgi?id=19137>
Signed-off-by: Julien Cristau <jcristau@debian.org>
-rw-r--r-- | src/xcb_disp.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/xcb_disp.c b/src/xcb_disp.c index 584380c..2625966 100644 --- a/src/xcb_disp.c +++ b/src/xcb_disp.c @@ -76,6 +76,11 @@ int _XConnectXCB(Display *dpy, _Xconst char *display, char **fullnamep, int *scr len = strlen(host) + (1 + 20 + 1 + 20 + 1); *fullnamep = Xmalloc(len); + if (!*fullnamep) { + free(host); + return 0; + } + snprintf(*fullnamep, len, "%s:%d.%d", host, n, *screenp); free(host); } |