Looking at the code here:
|
SEXP compile_data(SEXP data, SEXP options) { |
|
|
|
const char* data_string = CHAR(asChar(data)); |
|
// sass_delete_data_context will free input |
|
char* input = sass_copy_c_string(data_string); |
|
|
|
// freed by sass_delete_data_context |
|
struct Sass_Data_Context* data_context = sass_make_data_context(input); |
|
// Both context and options return the same data_context |
|
// pointer which is freed by sass_delete_data_context |
|
// https://github.com/sass/libsass/blob/ea0e39767600e879a2774509569a432b56cf4750/src/sass_context.cpp#L647 |
|
struct Sass_Context* context = sass_data_context_get_context(data_context); |
|
struct Sass_Options* sass_options = sass_context_get_options(context); |
|
|
|
set_options(sass_options, options); |
|
|
|
int status = sass_compile_data_context(data_context); |
|
|
|
if (status != 0) |
|
error("%s", sass_context_get_error_message(context)); |
|
|
|
SEXP ret = PROTECT(mkString(sass_context_get_output_string(context))); |
|
|
|
sass_delete_data_context(data_context); |
|
|
|
UNPROTECT(1); |
|
return ret; |
|
} |
It says:
Both context and options return the same data_context pointer which is freed by sass_delete_data_context
However, in the error code path, sass_delete_data_context() never gets called.
Looking at the code here:
sass/src/compile.c
Lines 113 to 140 in d9fe971
It says:
However, in the error code path,
sass_delete_data_context()never gets called.