Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
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

+5
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)