Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions st.c
Original file line number Diff line number Diff line change
Expand Up @@ -621,8 +621,8 @@ st_init_table_with_size(const struct st_hash_type *type, st_index_t size)
}
#endif
}
tab->entries = (st_table_entry *) malloc(get_allocated_entries(tab)
* sizeof(st_table_entry));
tab->entries = (st_table_entry *) calloc(get_allocated_entries(tab),
sizeof(st_table_entry));
#ifndef RUBY
if (tab->entries == NULL) {
st_free_table(tab);
Expand Down Expand Up @@ -1349,8 +1349,8 @@ st_copy(st_table *old_tab)
}
#endif
}
new_tab->entries = (st_table_entry *) malloc(get_allocated_entries(old_tab)
* sizeof(st_table_entry));
new_tab->entries = (st_table_entry *) calloc(get_allocated_entries(old_tab),
sizeof(st_table_entry));
#ifndef RUBY
if (new_tab->entries == NULL) {
st_free_table(new_tab);
Expand Down