Skip to content

Commit

Permalink
fix return NULL for some functions
Browse files Browse the repository at this point in the history
  • Loading branch information
ChenHuajun committed Jun 28, 2022
1 parent 5fa5426 commit e30ca4d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions roaring_buffer_reader.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ static void *rb_get_container_at_index(const roaring_buffer_t *rb, uint16_t i,
array_container_create_given_capacity(thiscard);
if(c == NULL) {// memory allocation failure
fprintf(stderr, "Failed to allocate memory for an array container.\n");
return false;
return NULL;
}
array_container_read(thiscard, c, buf);
answer = c;
Expand Down Expand Up @@ -559,15 +559,15 @@ roaring_bitmap_t *roaring_buffer_and(const roaring_buffer_t *ra1,
if(c1 == NULL)
{
roaring_bitmap_free(answer);
return false;
return NULL;
}
void *c2 = rb_get_container_at_index(ra2, pos2,
&container_type_2);
if(c2 == NULL)
{
container_free(c1, container_type_1);
roaring_bitmap_free(answer);
return false;
return NULL;
}
void *c = container_and(c1, container_type_1, c2, container_type_2,
&container_result_type);
Expand Down Expand Up @@ -632,15 +632,15 @@ roaring_bitmap_t *roaring_buffer_andnot(const roaring_buffer_t *x1,
if(c1 == NULL)
{
roaring_bitmap_free(answer);
return false;
return NULL;
}
void *c2 = rb_get_container_at_index(x2, pos2,
&container_type_2);
if(c2 == NULL)
{
container_free(c1, container_type_1);
roaring_bitmap_free(answer);
return false;
return NULL;
}
void *c =
container_andnot(c1, container_type_1, c2, container_type_2,
Expand Down

0 comments on commit e30ca4d

Please sign in to comment.