diff options
author | Petter Rodhelind <petter.rodhelind@gmail.com> | 2020-12-18 09:13:34 +0100 |
---|---|---|
committer | Petter Rodhelind <petter.rodhelind@gmail.com> | 2020-12-18 09:13:34 +0100 |
commit | 94c521bf102a74aec7e1a5c3a9ef5eaa968d4e14 (patch) | |
tree | ad1ad80ee9a4e0ae97451c94a7cf455d3068951b /src/libdraw/drawclient.c | |
parent | 7cda34cf34f3afbd3f2000aa5e2b59ddc319f0f2 (diff) | |
parent | 2991442aef1cf020ffde43673433ee97ef322a53 (diff) | |
download | plan9port-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.c | 7 |
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); |