Skip to content

Commit

Permalink
Fix a memory leak in rgba_2
Browse files Browse the repository at this point in the history
ALPHA_NUM throws on invalid argument. When this happened, `new_c` was never freed.
  • Loading branch information
glebm authored and xzyfer committed Nov 21, 2018
1 parent 0df09e6 commit 4589d07
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/fn_colors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ namespace Sass {
return SASS_MEMORY_NEW(String_Constant, pstate, strm.str());
}

Color_Ptr new_c = SASS_MEMORY_COPY(c_arg);
Color_Obj new_c = SASS_MEMORY_COPY(c_arg);
new_c->a(ALPHA_NUM("$alpha"));
new_c->disp("");
return new_c;
return new_c.detach();
}

////////////////
Expand Down

0 comments on commit 4589d07

Please sign in to comment.