diff options
author | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2016-04-12 19:29:22 +0200 |
---|---|---|
committer | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2016-04-12 19:29:22 +0200 |
commit | 5b304753965d4179f374b5cded063e79d3d17b0a (patch) | |
tree | 6d07ff08a9192fc985cb5216791359c1472890dd /src/core/lib/surface | |
parent | 7c37a687eb884c78d119d4b7903f173cca351255 (diff) |
Fixing a couple of issues within core.
Diffstat (limited to 'src/core/lib/surface')
-rw-r--r-- | src/core/lib/surface/server.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/lib/surface/server.c b/src/core/lib/surface/server.c index ad8ee8c7a9..e3b54ac012 100644 --- a/src/core/lib/surface/server.c +++ b/src/core/lib/surface/server.c @@ -251,7 +251,9 @@ static void channel_broadcaster_init(grpc_server *s, channel_broadcaster *cb) { count++; } cb->num_channels = count; - cb->channels = gpr_malloc(sizeof(*cb->channels) * cb->num_channels); + cb->channels = cb->num_channels + ? gpr_malloc(sizeof(*cb->channels) * cb->num_channels) + : NULL; count = 0; for (c = s->root_channel_data.next; c != &s->root_channel_data; c = c->next) { cb->channels[count++] = c->channel; |