mirror of
https://github.com/roc-lang/roc.git
synced 2024-09-21 15:59:20 +03:00
deallocate roc string in parser platform
This commit is contained in:
parent
9106479d07
commit
4ada4d4996
@ -143,9 +143,22 @@ int main() {
|
||||
size_t written = fwrite(str_bytes, sizeof(char), str_len, stdout);
|
||||
if (fflush(stdout) == 0 && written == str_len) {
|
||||
// Writing succeeded!
|
||||
|
||||
// dealllocate the roc string
|
||||
if (!(is_small_str(str))) {
|
||||
roc_dealloc(str_bytes - 8, 1);
|
||||
}
|
||||
|
||||
return 0;
|
||||
} else {
|
||||
printf("Error writing to stdout: %s\n", strerror(errno));
|
||||
|
||||
// dealllocate the roc string
|
||||
if (!(is_small_str(str))) {
|
||||
roc_dealloc(str_bytes - 8, 1);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user