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)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Sun, 21 Jul 2019 05:56:09 +0000 (01:56 -0400)
commit0361868a820211a562bc5b2cb915596ff2325fc2
tree68f40e6551d1ac87f2d4e77ae649610d61056e5f
parent6769570a7eb51bfa5c8d1aa3573e636eda47b131
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.025149 seconds and 4 git commands to generate.