Skip to content

Commit

Permalink
Fix source_c_str handling (don't copy since it is char*)
Browse files Browse the repository at this point in the history
Addresses sass#869

This is a breaking change since implementers need to
make a copy of the string if they are not able to pass
the complete memory ownership to libsass.
  • Loading branch information
mgreter committed Mar 8, 2015
1 parent 7e1b94b commit 3187a3c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -334,9 +334,10 @@ namespace Sass {
if(is_indented_syntax_src) {
char * contents = sass2scss(source_c_str, SASS2SCSS_PRETTIFY_1 | SASS2SCSS_KEEP_COMMENT);
add_source(input_path, input_path, contents);
delete [] source_c_str;
return parse_file();
}
add_source(input_path, input_path, sass_strdup(source_c_str));
add_source(input_path, input_path, source_c_str);
return parse_file();
}

Expand Down

0 comments on commit 3187a3c

Please sign in to comment.