1
0
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:
Magnus Hagander 2016-10-30 14:10:39 +01:00
parent d4b5d4cadd
commit a775406ec4

View File

@ -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;
}