-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix pc_patch_compress leak #112
Conversation
I came across this issue as well :
They could be made equivalent, saving a upcast-switch-downcast round-trip by putting the stats-freeing code (possibly wrapped in a function such as |
@mbredif that sounds like a better idea, that would fix any other similar leaks in one go. I'll get on it. |
…that from all the different pc_patch_*_free functions. - Ensure PCPATCH_*->stats is set to a valid value every time one is alloc'd. Vaglrind over unit tests caught a case in pc_patch_dimensional where the PCPATCH_DIMENSIONAL was being memcpy'd and not changing ->stats, resulting in a double-free.
Okay I've made the change @mbredif suggested and made a separate |
Is there an existing test in the testsuite that would make the leak evident (and confirm the fix) ? |
…pgpointcloud#112 for a more general fix
I have just stumbled yet again on this issue while addressing #135 in mbredif/pointcloud/pointlist_data. The non-equivalence of I included a quick fix but this PR would be more relevant. |
That's right, but couldn't the rule be "never call |
Replaced by #206. |
This fixes a memory leak in pc_patch_compress. See issue #111.