Commit 82b95b9e by Aaron Leung

Fixing the memory-leak test. No leaks.

parent 44637897
...@@ -14,28 +14,31 @@ int main(int argc, char** argv) ...@@ -14,28 +14,31 @@ int main(int argc, char** argv)
while (1) { while (1) {
getrusage(who, &r); getrusage(who, &r);
printf("Memory usage: %ld", r.ru_maxrss); printf("Memory usage: %ld\n", r.ru_maxrss);
struct sass_file_context* ctx = sass_new_file_context(); struct sass_file_context* ctx = sass_new_file_context();
ctx->options.include_paths = "::/blah/bloo/fuzz:/slub/flub/chub::/Users/Aaron/dev/libsass/::::/huzz/buzz:::"; ctx->options.include_paths = "::/blah/bloo/fuzz:/slub/flub/chub::/Users/Aaron/dev/libsass/::::/huzz/buzz:::";
ctx->options.output_style = SASS_STYLE_NESTED; ctx->options.output_style = SASS_STYLE_NESTED;
ctx->input_path = argv[1]; ctx->input_path = argv[1];
sass_file_compile(ctx); sass_compile_file(ctx);
if (ctx->error_status) { if (ctx->error_status) {
if (ctx->error_message) printf("%s", ctx->error_message); if (ctx->error_message) printf("%s", ctx->error_message);
else printf("An error occured; no error message available.\n"); else printf("An error occured; no error message available.\n");
sass_free_file_context(ctx);
break; break;
} }
else if (ctx->output_string) { else if (ctx->output_string) {
sass_free_file_context(ctx);
continue; continue;
} }
else { else {
printf("Unknown internal error.\n"); printf("Unknown internal error.\n");
sass_free_file_context(ctx);
break; break;
} }
sass_file_free_context(ctx);
} }
return 0; return 0;
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment