Skip to content

Commit 4589d07

Browse files
glebmxzyfer
authored andcommitted
Fix a memory leak in rgba_2
ALPHA_NUM throws on invalid argument. When this happened, `new_c` was never freed.
1 parent 0df09e6 commit 4589d07

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/fn_colors.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,10 @@ namespace Sass {
102102
return SASS_MEMORY_NEW(String_Constant, pstate, strm.str());
103103
}
104104

105-
Color_Ptr new_c = SASS_MEMORY_COPY(c_arg);
105+
Color_Obj new_c = SASS_MEMORY_COPY(c_arg);
106106
new_c->a(ALPHA_NUM("$alpha"));
107107
new_c->disp("");
108-
return new_c;
108+
return new_c.detach();
109109
}
110110

111111
////////////////

0 commit comments

Comments
 (0)