Skip to content

Commit 7410ecb

Browse files
committed
dump_json_ast: don't leak return value of graphql_ast_to_json
1 parent e94c515 commit 7410ecb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

dump_json_ast.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ int main(int argc, char **argv) {
4242
return 1;
4343
}
4444

45-
puts(graphql_ast_to_json((const struct GraphQLAstNode *)AST.get()));
45+
const char *json = graphql_ast_to_json((const struct GraphQLAstNode *)AST.get());
46+
puts(json);
47+
free((void *)json);
4648

4749
return 0;
4850
}

0 commit comments

Comments
 (0)