mirror of
https://github.com/yuzu-mirror/mbedtls.git
synced 2026-04-20 22:05:15 +00:00
Close file on error path
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
parent
d681ffdb54
commit
bbd92917d8
1 changed files with 2 additions and 0 deletions
|
|
@ -102,6 +102,7 @@ static int write_nv_seed(unsigned char *buf, size_t buf_len)
|
|||
|
||||
if (fwrite(buf, 1, MBEDTLS_ENTROPY_BLOCK_SIZE, f) !=
|
||||
MBEDTLS_ENTROPY_BLOCK_SIZE) {
|
||||
fclose(f);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
@ -124,6 +125,7 @@ int read_nv_seed(unsigned char *buf, size_t buf_len)
|
|||
|
||||
if (fread(buf, 1, MBEDTLS_ENTROPY_BLOCK_SIZE, f) !=
|
||||
MBEDTLS_ENTROPY_BLOCK_SIZE) {
|
||||
fclose(f);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue