mirror of
https://github.com/postgres/postgres.git
synced 2025-04-25 21:42:33 +03:00
Fix memory leak in tar file padding
Spotted by Coverity, patch by Michael Paquier
This commit is contained in:
parent
d4b5d4cadd
commit
a775406ec4
@ -442,9 +442,14 @@ tar_write_padding_data(TarMethodFile * f, size_t bytes)
|
||||
ssize_t r = tar_write(f, zerobuf, bytestowrite);
|
||||
|
||||
if (r < 0)
|
||||
{
|
||||
pg_free(zerobuf);
|
||||
return false;
|
||||
}
|
||||
bytesleft -= r;
|
||||
}
|
||||
|
||||
pg_free(zerobuf);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user