mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-22 05:20:21 +00:00
Fix file descriptor leak in turfwar.c
This commit is contained in:
parent
91e167caaf
commit
6ba3b448f3
1 changed files with 1 additions and 1 deletions
|
@ -652,7 +652,6 @@ bool ReloadAsset(struct Asset *a) {
|
||||||
FormatUnixHttpDateTime(lastmod, st.st_mtim.tv_sec);
|
FormatUnixHttpDateTime(lastmod, st.st_mtim.tv_sec);
|
||||||
CHECK_SYS((rc = read(fd, data.p, st.st_size)));
|
CHECK_SYS((rc = read(fd, data.p, st.st_size)));
|
||||||
if (rc != st.st_size) goto OnError;
|
if (rc != st.st_size) goto OnError;
|
||||||
close(fd);
|
|
||||||
gzip = Gzip(data);
|
gzip = Gzip(data);
|
||||||
//!//!//!//!//!//!//!//!//!//!//!//!//!/
|
//!//!//!//!//!//!//!//!//!//!//!//!//!/
|
||||||
nsync_mu_lock(&a->lock);
|
nsync_mu_lock(&a->lock);
|
||||||
|
@ -667,6 +666,7 @@ bool ReloadAsset(struct Asset *a) {
|
||||||
free(f[0]);
|
free(f[0]);
|
||||||
free(f[1]);
|
free(f[1]);
|
||||||
}
|
}
|
||||||
|
close(fd);
|
||||||
return true;
|
return true;
|
||||||
OnError:
|
OnError:
|
||||||
free(data.p);
|
free(data.p);
|
||||||
|
|
Loading…
Add table
Reference in a new issue