Skip to content

Commit 5290121

Browse files
lplewarbanka1
authored andcommitted
add missing error check for allocation
Signed-off-by: Łukasz Plewa <[email protected]>
1 parent 285d74f commit 5290121

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/pool/pool_disjoint.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -965,7 +965,10 @@ umf_memory_pool_ops_t *umfDisjointPoolOps(void) {
965965
umf_disjoint_pool_shared_limits_t *
966966
umfDisjointPoolSharedLimitsCreate(size_t max_size) {
967967
umf_disjoint_pool_shared_limits_t *ptr = umf_ba_global_alloc(sizeof(*ptr));
968-
//umf_ba_global_alloc(sizeof(*ptr));
968+
if (ptr == NULL) {
969+
LOG_ERR("cannot allocate memory for disjoint pool shared limits");
970+
return NULL;
971+
}
969972
ptr->max_size = max_size;
970973
ptr->total_size = 0;
971974
return ptr;

0 commit comments

Comments
 (0)