memory leak in win.c
Brought to you by:
apnadkarni
While I have no script to show the bug, looking at the code in twapi/base/win.c #290ff it seems quite obvious that there is a mismatch between comment and code:
/*
* Undo the incrref above. This will delete the object unless
* caller had done an incr-ref on it.
*/
for (i=0; i < ARRAYSIZE(objs); ++i) {
ObjIncrRefs(objs[i]);
}
Note the comment says "undo Incr-ref", yet the code does another IncrRef() instead of DecrRef().
Obvious patch:
diff -r cf302f454174 twapi/base/win.c
--- a/twapi/base/win.c Tue Oct 29 08:18:46 2019 +0530
+++ b/twapi/base/win.c Thu Dec 05 11:46:41 2019 +0100
@@ -292,7 +292,7 @@
* caller had done an incr-ref on it.
*/
for (i=0; i < ARRAYSIZE(objs); ++i) {
- ObjIncrRefs(objs[i]);
+ ObjDecrRefs(objs[i]);
}
return lresult;
TNX
R'
Anonymous
Urrk. Yes indeed.
Fixed for 4.3.9