Content-Length: 266995 | pFad | http://github.com/postgrespro/postgres_cluster/commit/969274d813018b08389956e493f691671f0d84f1

E7 Fix memory leak. · postgrespro/postgres_cluster@969274d · GitHub
Skip to content

Commit 969274d

Browse files
committed
Fix memory leak.
Memory is allocated twice for "file" and "files" variables in BufFileOpenShared(). Author: Antonin Houska Discussion: https://postgr.es/m/11329.1529045692%40localhost
1 parent 74da7cd commit 969274d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/backend/storage/file/buffile.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,10 +277,10 @@ BufFileCreateShared(SharedFileSet *fileset, const char *name)
277277
BufFile *
278278
BufFileOpenShared(SharedFileSet *fileset, const char *name)
279279
{
280-
BufFile *file = (BufFile *) palloc(sizeof(BufFile));
280+
BufFile *file;
281281
char segment_name[MAXPGPATH];
282282
Size capacity = 16;
283-
File *files = palloc(sizeof(File) * capacity);
283+
File *files;
284284
int nfiles = 0;
285285

286286
file = (BufFile *) palloc(sizeof(BufFile));

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres_cluster/commit/969274d813018b08389956e493f691671f0d84f1

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy