Skip to content

Commit a775406

Browse files
committed
Fix memory leak in tar file padding
Spotted by Coverity, patch by Michael Paquier
1 parent d4b5d4c commit a775406

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/bin/pg_basebackup/walmethods.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,9 +442,14 @@ tar_write_padding_data(TarMethodFile * f, size_t bytes)
442442
ssize_t r = tar_write(f, zerobuf, bytestowrite);
443443

444444
if (r < 0)
445+
{
446+
pg_free(zerobuf);
445447
return false;
448+
}
446449
bytesleft -= r;
447450
}
451+
452+
pg_free(zerobuf);
448453
return true;
449454
}
450455

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy