Skip to content

Commit 5132390

Browse files
committed
Return early if addresses pointer is null
1 parent 9bc207e commit 5132390

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

extension/maxminddb.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ static int ip_converter(PyObject *obj, struct sockaddr_storage *ip_address) {
242242
PyErr_SetString(
243243
PyExc_RuntimeError,
244244
"getaddrinfo was successful but failed to set the addrinfo");
245+
return 0;
245246
}
246247
memcpy(ip_address, addresses->ai_addr, addresses->ai_addrlen);
247248
freeaddrinfo(addresses);

0 commit comments

Comments
 (0)