-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
BUG: Memory leak bugs due to returned new reference is not decreased on failure (static analyzer reports) #35
Comments
Thanks for the report, much appreciated! I'll take a look in some while, right now away from proper machine to test. Just for my curiosity, which analyser did you use? I'd like to integrate it in GitHub hooks or at least release process, if it's freely available. |
It is an experimental analyzer developed on the top of Clang Static Analyzer. When the tool is publicly available, I will reply to this issue to tell you. Currently, I am busy writing the paper for this research. |
Sounds good, thank you - and thanks for finding the bugs! |
Issue #35 found two instances of memory leaks. This fixes the first one, which arguably is a more realistic case.
I've committed a fix for the first issue, which was very clear. For the second batch of issues, in the module initalisation, I'm not entirely sure what's the correct way of handling initialisation error - is deconstructing (via ref count decrease) the module the right thing? It seems so, but testing behaviour here is hard. |
Ah, actually the tutorial shows exactly this. Then it's a clear and simple fix. |
Returning a new reference here:
pyxattr/xattr.c
Line 632 in c3466e7
Variable
my_tuple
goes out of scope without decreasing the refcnt.pyxattr/xattr.c
Line 639 in c3466e7
Internal Report ID: 19f80b
Returning a new reference here:
pyxattr/xattr.c
Line 1185 in c3466e7
Error handling code after goto target does not decrease the refcnt. (also other
goto
s in this function)pyxattr/xattr.c
Line 1201 in c3466e7
Internal Report ID: 1eed62
The text was updated successfully, but these errors were encountered: