diff options
author | Mattias Andrée <maandree@kth.se> | 2016-08-05 14:56:14 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2016-08-05 14:56:14 +0200 |
commit | 192c713c9ab0e5597f2f690ebdf777203dcbcbbb (patch) | |
tree | ce47d3dcefd6e07c2e85eba3706a2c63a5b948b5 /src/state.c | |
parent | Fix bugs (diff) | |
download | coopgammad-192c713c9ab0e5597f2f690ebdf777203dcbcbbb.tar.gz coopgammad-192c713c9ab0e5597f2f690ebdf777203dcbcbbb.tar.bz2 coopgammad-192c713c9ab0e5597f2f690ebdf777203dcbcbbb.tar.xz |
Fix bugs
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r-- | src/state.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/state.c b/src/state.c index d840ccb..71e2146 100644 --- a/src/state.c +++ b/src/state.c @@ -298,6 +298,10 @@ size_t state_unmarshal(const void* restrict buf) outputs_n = *(const size_t*)(bs + off); off += sizeof(size_t); + outputs = calloc(outputs_n, sizeof(*outputs)); + if (outputs == NULL) + return 0; + for (i = 0; i < outputs_n; i++) { off += n = output_unmarshal(outputs + i, bs + off); |