-
Notifications
You must be signed in to change notification settings - Fork 118
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
Introduce unique_cstr
.
#3245
Introduce unique_cstr
.
#3245
Conversation
✔️ 5b6bf9d -> Azure artifacts URL |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3245 +/- ##
=======================================
Coverage 67.09% 67.09%
=======================================
Files 570 571 +1
Lines 111082 111089 +7
=======================================
+ Hits 74525 74532 +7
Misses 36557 36557 ☔ View full report in Codecov by Sentry. |
This comment has been minimized.
This comment has been minimized.
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.
Nice work!
The difficulty is this line here: nrn/src/nrnpython/nrnpy_hoc.cpp Lines 739 to 741 in 5b6bf9d
it leaks all strings stored in |
This comment has been minimized.
This comment has been minimized.
This commit adds a RAII wrapper for C-strings, called `unique_cstr`. Several places in the NRN Python bindings use `char *` when owning a malloc allocated string. This new class is then used to prevent leaking HOC strings on error paths.
Quality Gate passedIssues Measures |
✔️ 9ed485b -> Azure artifacts URL |
This commit adds a RAII wrapper for C-strings, called
unique_cstr
. Several places in the NRN Python bindings usechar *
when owning a malloc allocated string.This new class is then used to prevent leaking HOC strings on error paths, see #1437