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