Skip to content

Commit 7bb53e8

Browse files
committed
DISPATCH-2316 Py_INCREF usage of Py_True/Py_False to prevent crashes during GC
1 parent eab441f commit 7bb53e8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/python_embedded.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -409,14 +409,15 @@ PyObject *qd_field_to_py(qd_parsed_field_t *field)
409409
uint8_t tag = qd_parse_tag(field);
410410
switch (tag) {
411411
case QD_AMQP_NULL:
412-
Py_INCREF(Py_None);
413412
result = Py_None;
413+
Py_INCREF(result);
414414
break;
415415

416416
case QD_AMQP_BOOLEAN:
417417
case QD_AMQP_TRUE:
418418
case QD_AMQP_FALSE:
419419
result = qd_parse_as_uint(field) ? Py_True : Py_False;
420+
Py_INCREF(result);
420421
break;
421422

422423
case QD_AMQP_UBYTE:

0 commit comments

Comments
 (0)