Skip to content

Commit feff4f5

Browse files
authored
Merge pull request #2259 from mgreter/bugfix/c-api-copy-options
Fixes issue with C-API `copy_options` function
2 parents 9003a00 + 9266ee2 commit feff4f5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/sass_context.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,8 @@ extern "C" {
259259
static void sass_clear_options (struct Sass_Options* options);
260260
static void sass_reset_options (struct Sass_Options* options);
261261
static void copy_options(struct Sass_Options* to, struct Sass_Options* from) {
262+
// do not overwrite ourself
263+
if (to == from) return;
262264
// free assigned memory
263265
sass_clear_options(to);
264266
// move memory

0 commit comments

Comments
 (0)