Skip to content

Commit

Permalink
Check error from from_entry_data_list
Browse files Browse the repository at this point in the history
  • Loading branch information
oschwald committed May 4, 2020
1 parent 5433299 commit ee2892b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions extension/maxminddb.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,11 @@ static int get_record(PyObject *self, PyObject *args, PyObject **record) {
*record = from_entry_data_list(&entry_data_list);
MMDB_free_entry_data_list(original_entry_data_list);

// from_entry_data_list will return NULL on errors.
if (*record == NULL) {
return -1;
}

return prefix_len;
}

Expand Down

0 comments on commit ee2892b

Please sign in to comment.