mirror of
https://github.com/curl/curl.git
synced 2024-11-21 01:16:58 +08:00
metalink: fix resource leak in OOM
Coverity CID 1288826
This commit is contained in:
parent
8ecfaad2cc
commit
1977ff811d
@ -621,8 +621,10 @@ static int check_hash(const char *filename,
|
||||
}
|
||||
|
||||
result = malloc(digest_def->dparams->digest_resultlen);
|
||||
if(!result)
|
||||
if(!result) {
|
||||
close(fd);
|
||||
return -1;
|
||||
}
|
||||
while(1) {
|
||||
unsigned char buf[4096];
|
||||
ssize_t len = read(fd, buf, sizeof(buf));
|
||||
|
Loading…
Reference in New Issue
Block a user