diff options
author | Jenkins <jenkins@review.openstack.org> | 2016-11-24 00:18:08 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2016-11-24 00:18:09 +0000 |
commit | 0a79a4889eb8e48737b40af6c34d8d519ba6aff3 (patch) | |
tree | 2bda707b7f983fbb5840dbe6ba6529c199207f4a | |
parent | bcc98b5acea27949109ad18f8cfb301ba3a666a3 (diff) | |
parent | 10d6fa5f02dd9a3a7bd6cd00ce79b78a1446d7d0 (diff) | |
download | liberasurecode-0a79a4889eb8e48737b40af6c34d8d519ba6aff3.tar.gz |
Merge "Fix reconstruct to return an error when memory allocation failed"
-rw-r--r-- | src/erasurecode.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/erasurecode.c b/src/erasurecode.c index d3b3cea..fdae72a 100644 --- a/src/erasurecode.c +++ b/src/erasurecode.c @@ -812,18 +812,21 @@ int liberasurecode_reconstruct_fragment(int desc, data = alloc_zeroed_buffer(sizeof(char*) * k); if (NULL == data) { log_error("Could not allocate data buffer!"); + ret = -ENOMEM; goto out; } parity = alloc_zeroed_buffer(sizeof(char*) * m); if (NULL == parity) { log_error("Could not allocate parity buffer!"); + ret = -ENOMEM; goto out; } missing_idxs = alloc_and_set_buffer(sizeof(int*) * (k + m), -1); if (NULL == missing_idxs) { log_error("Could not allocate missing_idxs buffer!"); + ret = -ENOMEM; goto out; } |