aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/devdraw/srv.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/devdraw/srv.c')
-rw-r--r--src/cmd/devdraw/srv.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/cmd/devdraw/srv.c b/src/cmd/devdraw/srv.c
index 05a08fda..479e41e0 100644
--- a/src/cmd/devdraw/srv.c
+++ b/src/cmd/devdraw/srv.c
@@ -88,7 +88,7 @@ threadmain(int argc, char **argv)
void
gfx_started(void)
{
- char *addr;
+ char *ns, *addr;
if(srvname == nil) {
// Legacy mode: serving single client on pipes.
@@ -97,7 +97,11 @@ gfx_started(void)
}
// Server mode.
- addr = smprint("unix!%s/%s", getns(), srvname);
+ if((ns = getns()) == nil)
+ sysfatal("out of memory");
+
+ addr = smprint("unix!%s/%s", ns, srvname);
+ free(ns);
if(addr == nil)
sysfatal("out of memory");