Fix: bt2: incref Py_None in get_msg_range_common on error
authorSimon Marchi <simon.marchi@efficios.com>
Sun, 21 Jul 2019 03:10:41 +0000 (23:10 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 7 Aug 2019 18:05:18 +0000 (14:05 -0400)
commit752f4edff08c89a454d87babd46f9c0dbc83227f
treee9cd3cca6e7a850a0510b8b91d9c76f01a6c247f
parent88efd0a70f526da4e99d08b20f6f9dd5ab8157ef
Fix: bt2: incref Py_None in get_msg_range_common on error

When get_msg_range_common processes a result that is not OK, it
returns a tuple whose second element is None:

  (status, None)

However, when setting the second element of the tuple to None, we are
missing an incref of Py_None.  This incref is necessary, because
PyTuple_SET_ITEM steals the reference of the object we pass.

This patch fixes that.

Change-Id: I8a5af2853172a8399dd1779d90e0fcb8fc265032
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1731
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Tested-by: jenkins <jenkins@lttng.org>
src/bindings/python/bt2/bt2/native_bt_message_iterator.i
tests/bindings/python/bt2/test_message_iterator.py
This page took 0.025298 seconds and 4 git commands to generate.