Skip to content

Commit

Permalink
DISPATCH-2316 Py_INCREF usage of Py_True/Py_False to prevent crashes …
Browse files Browse the repository at this point in the history
…during GC
  • Loading branch information
jiridanek committed Jan 22, 2022
1 parent eab441f commit 7bb53e8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/python_embedded.c
Original file line number Diff line number Diff line change
Expand Up @@ -409,14 +409,15 @@ PyObject *qd_field_to_py(qd_parsed_field_t *field)
uint8_t tag = qd_parse_tag(field);
switch (tag) {
case QD_AMQP_NULL:
Py_INCREF(Py_None);
result = Py_None;
Py_INCREF(result);
break;

case QD_AMQP_BOOLEAN:
case QD_AMQP_TRUE:
case QD_AMQP_FALSE:
result = qd_parse_as_uint(field) ? Py_True : Py_False;
Py_INCREF(result);
break;

case QD_AMQP_UBYTE:
Expand Down

0 comments on commit 7bb53e8

Please sign in to comment.