Skip to content

Commit b57e6e2

Browse files
committed
PYTHON-1599 Fix unchecked return value in cmessagemodule
1 parent f82706c commit b57e6e2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pymongo/_cmessagemodule.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1199,6 +1199,10 @@ _batched_op_msg(
11991199
}
12001200
/* Save space for size */
12011201
size_location = buffer_save_space(buffer, 4);
1202+
if (size_location == -1) {
1203+
PyErr_NoMemory();
1204+
return 0;
1205+
}
12021206

12031207
switch (op) {
12041208
case _INSERT:

0 commit comments

Comments
 (0)