We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f6a100e commit be07f99Copy full SHA for be07f99
src/sass_context.cpp
@@ -330,7 +330,9 @@ extern "C" {
330
c_ctx->error_column = std::string::npos;
331
332
// allocate a new compiler instance
333
- Sass_Compiler* compiler = (struct Sass_Compiler*) calloc(1, sizeof(struct Sass_Compiler));
+ void* ctxmem = calloc(1, sizeof(struct Sass_Compiler));
334
+ if (ctxmem == 0) { std::cerr << "Error allocating memory for context" << std::endl; return 0; }
335
+ Sass_Compiler* compiler = (struct Sass_Compiler*) ctxmem;
336
compiler->state = SASS_COMPILER_CREATED;
337
338
// store in sass compiler
0 commit comments