Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.3k
gh-87804: Fix error handling and style in_pystatvfs_fromstructstatfs#115236
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
ronaldoussoren left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
LGTM
| PyStructSequence_SET_ITEM(v,7, | ||
| PyLong_FromLongLong((long long)st.f_ffree)); | ||
| PyStructSequence_SET_ITEM(v,8,PyLong_FromLong((long)flags)); | ||
| #defineSET_ITEM(v,index,item) \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
@sobolevn, the macro expansion of this will leak memory:item gets substituted asPyLong_FromLong, etc. at every occurrence, i.e.:
do { if (PyLong_FromLong((long) st.f_iosize) == NULL) { Py_DECREF(v); return NULL; } PyStructSequence_SET_ITEM(v, 0, PyLong_FromLong((long) st.f_iosize)); } while (0)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Oh, looks like you already figured it out 😊
sobolevn commentedFeb 12, 2024
Fix:#115335 |
Uh oh!
There was an error while loading.Please reload this page.
Things I've fixed: