Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9121088 commit a9b6033Copy full SHA for a9b6033
1 file changed
Lib/ctypes/test/test_stringptr.py
@@ -70,8 +70,8 @@ def test_functions(self):
70
x = r[0], r[1], r[2], r[3], r[4]
71
self.assertEqual(x, (b"c", b"d", b"e", b"f", b"\000"))
72
del buf
73
- # x1 will NOT be the same as x, usually:
74
- x1 = r[0], r[1], r[2], r[3], r[4]
+ # Because r is a pointer to memory that is freed after deleting buf,
+ # the pointer is hanging and using it would reference freed memory.
75
76
if __name__ == '__main__':
77
unittest.main()
0 commit comments