8000 fix potential double free · pythonnet/pythonnet@65a5f45 · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 65a5f45

Browse files
committed
fix potential double free
1 parent 2b9dbea commit 65a5f45

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/embed_tests/Codecs.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -218,13 +218,9 @@ public void SequenceDecoderTest()
218218
Assert.IsFalse(codec.CanDecode(fooType, typeof(ICollection<int>)));
219219

220220
//python tuples do satisfy the python sequence protocol
221-
var pyTuple = new PyObject(Runtime.PyTuple_New(3));
221+
var pyTuple = new PyTuple(items.ToArray());
222222
var pyTupleType = pyTuple.GetPythonType();
223223

224-
Runtime.PyTuple_SetItem(pyTuple.Handle, 0, items[0].Handle);
225-
Runtime.PyTuple_SetItem(pyTuple.Handle, 1, items[1].Handle);
226-
Runtime.PyTuple_SetItem(pyTuple.Handle, 2, items[2].Handle);
227-
228224
Assert.IsTrue(codec.CanDecode(pyTupleType, typeof(ICollection<float>)));
229225
Assert.IsTrue(codec.CanDecode(pyTupleType, typeof(ICollection<int>)));
230226
Assert.IsTrue(codec.CanDecode(pyTupleType, typeof(ICollection<string>)));

0 commit comments

Comments
 (0)
0