You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When creating new Perl values through API functions like newSVpv() or hv_store(), const char* values are internally copied into memory that is managed by Perl itself. Manually allocating a buffer isn't necessary. Our neo4j_string_to_alloc_str() function does allocate a buffer and never frees it, causing a leak. neo4j_ustring_value() should be used instead.
However, neo4j_ustring_value() currently doesn't return a valid pointer for empty strings, so we need to special-case that. (majensen/libneo4j-omni#10)
When returning SVs from an XSUB, assigning them to a Perl variable will increment their ref count, which causes a leak unless the SV on the stack is mortal. If the SV* typemap is used, they become mortal automatically when they are returned. However, when instead pushing SVs onto the value stack manually, the SVs need to be mortalised manually as well.
0 commit comments