mirror of
https://github.com/moparisthebest/curl
synced 2024-12-21 23:58:49 -05: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