From 4589d07cd645f66903fb21b6eee3e0690e61429d Mon Sep 17 00:00:00 2001 From: Gleb Mazovetskiy Date: Wed, 21 Nov 2018 01:17:00 +0000 Subject: [PATCH] Fix a memory leak in `rgba_2` ALPHA_NUM throws on invalid argument. When this happened, `new_c` was never freed. --- src/fn_colors.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fn_colors.cpp b/src/fn_colors.cpp index 6bbc97ef6..7f501db13 100644 --- a/src/fn_colors.cpp +++ b/src/fn_colors.cpp @@ -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(); } ////////////////