Skip to content

Commit dac1d78

Browse files
committed
Use correct size in reallocs
1 parent f5965ce commit dac1d78

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/bson.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ static void php_phongo_field_path_ensure_allocation(php_phongo_field_path* field
121121
size_t i;
122122

123123
field_path->allocated_size = field_path->size + PHONGO_FIELD_PATH_EXPANSION;
124-
field_path->elements = erealloc(field_path->elements, sizeof(char**) * field_path->allocated_size);
125-
field_path->element_types = erealloc(field_path->element_types, sizeof(php_phongo_bson_field_path_item_types*) * field_path->allocated_size);
124+
field_path->elements = erealloc(field_path->elements, sizeof(char*) * field_path->allocated_size);
125+
field_path->element_types = erealloc(field_path->element_types, sizeof(php_phongo_bson_field_path_item_types) * field_path->allocated_size);
126126

127127
for (i = level; i < field_path->allocated_size; i++) {
128128
field_path->elements[i] = NULL;

0 commit comments

Comments
 (0)