Commit 54c8ed5
authored
Fixed reference/memory leaks in decode_definite_long_string (#290)
Two reference/memory leaks in the C extension's long string decoder:
1. Missing Py_DECREF(ret) before reassignment after PyUnicode_Concat,
leaking all intermediate Unicode objects during chunked decoding.
2. Missing PyMem_Free(buffer) on the success path, leaking the scratch
buffer used for UTF-8 boundary handling.1 parent a8d92dc commit 54c8ed5
File tree
3 files changed
+9
-1
lines changed- docs
- scripts
- source
3 files changed
+9
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
| 89 | + | |
88 | 90 | | |
89 | 91 | | |
90 | 92 | | |
| |||
105 | 107 | | |
106 | 108 | | |
107 | 109 | | |
108 | | - | |
| 110 | + | |
109 | 111 | | |
110 | 112 | | |
111 | 113 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
937 | 937 | | |
938 | 938 | | |
939 | 939 | | |
| 940 | + | |
940 | 941 | | |
941 | 942 | | |
942 | 943 | | |
| |||
969 | 970 | | |
970 | 971 | | |
971 | 972 | | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
972 | 976 | | |
973 | 977 | | |
974 | 978 | | |
| |||
0 commit comments