aboutsummaryrefslogtreecommitdiff
path: root/src/libdraw/drawclient.c
diff options
context:
space:
mode:
authorPetter Rodhelind <petter.rodhelind@gmail.com>2020-12-18 09:13:34 +0100
committerPetter Rodhelind <petter.rodhelind@gmail.com>2020-12-18 09:13:34 +0100
commit94c521bf102a74aec7e1a5c3a9ef5eaa968d4e14 (patch)
treead1ad80ee9a4e0ae97451c94a7cf455d3068951b /src/libdraw/drawclient.c
parent7cda34cf34f3afbd3f2000aa5e2b59ddc319f0f2 (diff)
parent2991442aef1cf020ffde43673433ee97ef322a53 (diff)
downloadplan9port-94c521bf102a74aec7e1a5c3a9ef5eaa968d4e14.tar.gz
plan9port-94c521bf102a74aec7e1a5c3a9ef5eaa968d4e14.tar.bz2
plan9port-94c521bf102a74aec7e1a5c3a9ef5eaa968d4e14.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'src/libdraw/drawclient.c')
-rw-r--r--src/libdraw/drawclient.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libdraw/drawclient.c b/src/libdraw/drawclient.c
index c38f4801..2ac1b232 100644
--- a/src/libdraw/drawclient.c
+++ b/src/libdraw/drawclient.c
@@ -23,7 +23,7 @@ int
_displayconnect(Display *d)
{
int pid, p[2], fd, nbuf, n;
- char *wsysid, *addr, *id;
+ char *wsysid, *ns, *addr, *id;
uchar *buf;
Wsysmsg w;
@@ -40,7 +40,10 @@ _displayconnect(Display *d)
return -1;
}
*id++ = '\0';
- addr = smprint("unix!%s/%s", getns(), wsysid);
+ if((ns = getns()) == nil)
+ return -1;
+ addr = smprint("unix!%s/%s", ns, wsysid);
+ free(ns);
if(addr == nil)
return -1;
fd = dial(addr, 0, 0, 0);