Skip to content

Commit ee2892b

Browse files
committed
Check error from from_entry_data_list
1 parent 5433299 commit ee2892b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

extension/maxminddb.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,11 @@ static int get_record(PyObject *self, PyObject *args, PyObject **record) {
204204
*record = from_entry_data_list(&entry_data_list);
205205
MMDB_free_entry_data_list(original_entry_data_list);
206206

207+
// from_entry_data_list will return NULL on errors.
208+
if (*record == NULL) {
209+
return -1;
210+
}
211+
207212
return prefix_len;
208213
}
209214

0 commit comments

Comments
 (0)