Skip to content

Commit 19cea72

Browse files
committed
Fix memory issue with plugin interface
We should make a copy of the signature, as we don't want the caller to handle the lifespan and the costs should be reasonable in all cases. Changing experimental API is fun.
1 parent 49bc8f0 commit 19cea72

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/sass_functions.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ extern "C" {
2626

2727
void ADDCALL sass_delete_function(Sass_Function_Entry entry)
2828
{
29+
free(entry->signature);
2930
free(entry);
3031
}
3132

src/sass_functions.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
// Struct to hold custom function callback
99
struct Sass_Function {
10-
const char* signature;
10+
char* signature;
1111
Sass_Function_Fn function;
1212
void* cookie;
1313
};

0 commit comments

Comments
 (0)