Skip to content

Commit

Permalink
Fix memory leak in Sass::Eval::operator()(Sass::String_Schema*) (#3060)
Browse files Browse the repository at this point in the history
  • Loading branch information
xzyfer authored Feb 12, 2020
1 parent 16f76e2 commit 1b9d52d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/eval.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1286,7 +1286,8 @@ namespace Sass {
}
if (!s->is_interpolant()) {
if (s->length() > 1 && res == "") return SASS_MEMORY_NEW(Null, s->pstate());
return SASS_MEMORY_NEW(String_Constant, s->pstate(), res, s->css());
String_Constant_Obj str = SASS_MEMORY_NEW(String_Constant, s->pstate(), res, s->css());
return str.detach();
}
// string schema seems to have a special unquoting behavior (also handles "nested" quotes)
String_Quoted_Obj str = SASS_MEMORY_NEW(String_Quoted, s->pstate(), res, 0, false, false, false, s->css());
Expand Down

0 comments on commit 1b9d52d

Please sign in to comment.