Skip to content

Commit

Permalink
Ensure we keep around memory for parser source
Browse files Browse the repository at this point in the history
  • Loading branch information
mgreter committed Jan 20, 2016
1 parent f1155e4 commit 47797f8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/expand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,11 @@ namespace Sass {
Statement* Expand::operator()(Media_Block* m)
{
Expression* mq = m->media_queries()->perform(&eval);
mq = Parser::from_c_str(mq->to_string(ctx.c_options).c_str(), ctx, mq->pstate()).parse_media_queries();
std::string str_mq(mq->to_string(ctx.c_options));
char* str = sass_strdup(str_mq.c_str());
ctx.strings.push_back(str);
Parser p(Parser::from_c_str(str, ctx, mq->pstate()));
mq = p.parse_media_queries();
Media_Block* mm = SASS_MEMORY_NEW(ctx.mem, Media_Block,
m->pstate(),
static_cast<List*>(mq->perform(&eval)),
Expand Down

0 comments on commit 47797f8

Please sign in to comment.