Skip to content
This repository was archived by the owner on Oct 24, 2025. It is now read-only.

Commit 1f32179

Browse files
committed
Fix another memory leak with custom importer
1 parent 1b72808 commit 1f32179

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

parser.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ namespace Sass {
174174
sass_import_get_path(current),
175175
cookie);
176176
if (includes) {
177+
struct Sass_Import** list = includes;
177178
while (*includes) {
178179
struct Sass_Import* include = *includes;
179180
const char *file = sass_import_get_path(include);
@@ -192,13 +193,11 @@ namespace Sass {
192193
}
193194
++includes;
194195
}
195-
// go for next parse loop
196+
// deallocate returned memory
197+
sass_delete_import_list(list);
198+
// parse next import
196199
continue;
197200
}
198-
// deallocate returned memory
199-
sass_delete_import_list(includes);
200-
// custom importer returned nothing
201-
// means we should use default loader
202201
}
203202

204203
add_single_file(imp, import_path);

0 commit comments

Comments
 (0)