Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
node-sass
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
楚学文
node-sass
Commits
3052263f
Commit
3052263f
authored
Oct 31, 2017
by
Stefan Penner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[LEAK FIX] create_string must be paired with a free
parent
4cf43ac9
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
2 deletions
+16
-2
binding.cpp
src/binding.cpp
+4
-1
callback_bridge.h
src/callback_bridge.h
+0
-0
custom_importer_bridge.cpp
src/custom_importer_bridge.cpp
+2
-0
number.cpp
src/sass_types/number.cpp
+4
-0
string.cpp
src/sass_types/string.cpp
+6
-1
No files found.
src/binding.cpp
View file @
3052263f
...
...
@@ -158,7 +158,9 @@ int ExtractOptions(v8::Local<v8::Object> options, void* cptr, sass_context_wrapp
CustomFunctionBridge
*
bridge
=
new
CustomFunctionBridge
(
callback
,
ctx_w
->
is_sync
);
ctx_w
->
function_bridges
.
push_back
(
bridge
);
Sass_Function_Entry
fn
=
sass_make_function
(
create_string
(
signature
),
sass_custom_function
,
bridge
);
char
*
sig
=
create_string
(
signature
);
Sass_Function_Entry
fn
=
sass_make_function
(
sig
,
sass_custom_function
,
bridge
);
free
(
sig
);
sass_function_set_list_entry
(
fn_list
,
i
,
fn
);
}
...
...
@@ -290,6 +292,7 @@ NAN_METHOD(render_sync) {
}
sass_free_context_wrapper
(
ctx_w
);
info
.
GetReturnValue
().
Set
(
result
==
0
);
}
...
...
src/callback_bridge.h
View file @
3052263f
src/custom_importer_bridge.cpp
View file @
3052263f
...
...
@@ -29,6 +29,7 @@ SassImportList CustomImporterBridge::post_process_return_value(v8::Local<v8::Val
imports
[
i
]
=
sass_make_import_entry
(
0
,
0
,
0
);
sass_import_set_error
(
imports
[
i
],
message
,
-
1
,
-
1
);
free
(
message
);
}
else
{
imports
[
i
]
=
get_importer_entry
(
object
);
...
...
@@ -43,6 +44,7 @@ SassImportList CustomImporterBridge::post_process_return_value(v8::Local<v8::Val
imports
[
0
]
=
sass_make_import_entry
(
0
,
0
,
0
);
sass_import_set_error
(
imports
[
0
],
message
,
-
1
,
-
1
);
free
(
message
);
}
else
if
(
returned_value
->
IsObject
())
{
imports
=
sass_make_import_list
(
1
);
...
...
src/sass_types/number.cpp
View file @
3052263f
...
...
@@ -23,6 +23,10 @@ namespace SassTypes
}
unit
=
create_string
(
raw_val
[
1
]);
*
out
=
sass_make_number
(
value
,
unit
);
delete
unit
;
return
*
out
;
}
}
...
...
src/sass_types/string.cpp
View file @
3052263f
...
...
@@ -15,11 +15,16 @@ namespace SassTypes
}
value
=
create_string
(
raw_val
[
0
]);
}
*
out
=
sass_make_string
(
value
);
delete
value
;
return
*
out
;
}
else
{
return
*
out
=
sass_make_string
(
value
);
}
}
void
String
::
initPrototype
(
v8
::
Local
<
v8
::
FunctionTemplate
>
proto
)
{
Nan
::
SetPrototypeMethod
(
proto
,
"getValue"
,
GetValue
);
Nan
::
SetPrototypeMethod
(
proto
,
"setValue"
,
SetValue
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment