Skip to content

Commit

Permalink
Use ecalloc rather than emalloc
Browse files Browse the repository at this point in the history
  • Loading branch information
oschwald committed Dec 18, 2019
1 parent 5b373ae commit 0653682
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ext/maxminddb.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ PHP_METHOD(MaxMind_Db_Reader, __construct) {
return;
}

MMDB_s *mmdb = (MMDB_s *)emalloc(sizeof(MMDB_s));
MMDB_s *mmdb = (MMDB_s *)ecalloc(1, sizeof(MMDB_s));
uint16_t status = MMDB_open(db_file, MMDB_MODE_MMAP, mmdb);

if (MMDB_SUCCESS != status) {
Expand Down

0 comments on commit 0653682

Please sign in to comment.