LOG: set the return code when calloc fails

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
This commit is contained in:
Angus Salkeld 2012-11-23 10:24:56 +11:00
parent 709b32de43
commit a5795f7d45

View File

@ -139,6 +139,7 @@ qb_array_index(struct qb_array * a, int32_t idx, void **element_out)
if (a->bin[b] == NULL) {
a->bin[b] = calloc(MAX_ELEMENTS_PER_BIN, a->element_size);
if (a->bin[b] == NULL) {
rc = -errno;
goto unlock_error;
}
bin_alloced = QB_TRUE;