aboutsummaryrefslogtreecommitdiff
path: root/src/libthread/channel.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libthread/channel.c')
-rw-r--r--src/libthread/channel.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libthread/channel.c b/src/libthread/channel.c
index 3c9614e6..c8c96796 100644
--- a/src/libthread/channel.c
+++ b/src/libthread/channel.c
@@ -22,6 +22,8 @@ chancreate(int elemsize, int bufsize)
Channel *c;
c = malloc(sizeof *c+bufsize*elemsize);
+ if(c == nil)
+ sysfatal("chancreate malloc: %r");
memset(c, 0, sizeof *c);
c->elemsize = elemsize;
c->bufsize = bufsize;