Commit a775406e authored by Magnus Hagander's avatar Magnus Hagander

Fix memory leak in tar file padding

Spotted by Coverity, patch by Michael Paquier
parent d4b5d4ca
...@@ -442,9 +442,14 @@ tar_write_padding_data(TarMethodFile * f, size_t bytes) ...@@ -442,9 +442,14 @@ tar_write_padding_data(TarMethodFile * f, size_t bytes)
ssize_t r = tar_write(f, zerobuf, bytestowrite); ssize_t r = tar_write(f, zerobuf, bytestowrite);
if (r < 0) if (r < 0)
{
pg_free(zerobuf);
return false; return false;
}
bytesleft -= r; bytesleft -= r;
} }
pg_free(zerobuf);
return true; return true;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment