projects
/
postgresql.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
74da7cd
)
Fix memory leak.
author
Tatsuo Ishii
<ishii@postgresql.org>
Fri, 15 Jun 2018 07:32:59 +0000
(16:32 +0900)
committer
Tatsuo Ishii
<ishii@postgresql.org>
Fri, 15 Jun 2018 07:32:59 +0000
(16:32 +0900)
Memory is allocated twice for "file" and "files" variables in
BufFileOpenShared().
Author: Antonin Houska
Discussion: https://postgr.es/m/11329.
1529045692
%40localhost
src/backend/storage/file/buffile.c
patch
|
blob
|
blame
|
history
diff --git
a/src/backend/storage/file/buffile.c
b/src/backend/storage/file/buffile.c
index d8a18dd3dcb3f2127c55654265c7082403eae9c5..00f61748b347bae9578ee77bd62deaa88e23ddc6 100644
(file)
--- a/
src/backend/storage/file/buffile.c
+++ b/
src/backend/storage/file/buffile.c
@@
-277,10
+277,10
@@
BufFileCreateShared(SharedFileSet *fileset, const char *name)
BufFile *
BufFileOpenShared(SharedFileSet *fileset, const char *name)
{
- BufFile *file
= (BufFile *) palloc(sizeof(BufFile))
;
+ BufFile *file;
char segment_name[MAXPGPATH];
Size capacity = 16;
- File *files
= palloc(sizeof(File) * capacity)
;
+ File *files;
int nfiles = 0;
file = (BufFile *) palloc(sizeof(BufFile));