Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix memory leak
Browse files Browse the repository at this point in the history
simonexmachina committed Oct 19, 2014

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent aca759d commit 6ee4b3b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions source_map.cpp
Original file line number Diff line number Diff line change
@@ -48,12 +48,14 @@ namespace Sass {

if (include_sources) {
result += " \"sourcesContent\": ";
JsonNode *triples = json_mkarray();
JsonNode *sourcesContent = json_mkarray();
for (size_t i = 0; i < files.size(); ++i) {
json_append_element(triples, json_mkstring(files[i].second));
json_append_element(sourcesContent, json_mkstring(files[i].second));
}
result += json_stringify(triples, "\t");
json_delete(triples);
char *str = json_stringify(sourcesContent, "\t");
result += str;
free(str);
json_delete(sourcesContent);
if (!files.empty()) result.erase(result.length() - 1);
result += ",\n";
}

0 comments on commit 6ee4b3b

Please sign in to comment.