projects
/
postgresql.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d4b5d4c
)
Fix memory leak in tar file padding
author
Magnus Hagander
<
[email protected]
>
Sun, 30 Oct 2016 13:10:39 +0000
(14:10 +0100)
committer
Magnus Hagander
<
[email protected]
>
Sun, 30 Oct 2016 13:10:39 +0000
(14:10 +0100)
Spotted by Coverity, patch by Michael Paquier
src/bin/pg_basebackup/walmethods.c
patch
|
blob
|
blame
|
history
diff --git
a/src/bin/pg_basebackup/walmethods.c
b/src/bin/pg_basebackup/walmethods.c
index 1ecc23c2560b83bcd3414444997c105e288e14b2..40c8a5c697c38c53a99dae3c4fbf077f0f674e83 100644
(file)
--- a/
src/bin/pg_basebackup/walmethods.c
+++ b/
src/bin/pg_basebackup/walmethods.c
@@
-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;
}