fix fp memory leak
This commit is contained in:
parent
d4b8c18708
commit
5c914908d5
1 changed files with 3 additions and 0 deletions
3
gen.c
3
gen.c
|
@ -86,6 +86,9 @@ Chunk fetch_chunk(int x, int y, int z, int ci) {
|
|||
fclose(fp);
|
||||
return chunk;
|
||||
}
|
||||
if (fp != 0) {
|
||||
fclose(fp);
|
||||
}
|
||||
if (!fp) {
|
||||
fp = fopen(fname, "wb");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue