Skip to content

Commit e0f76f2

Browse files
committed
pg_waldump: Fix small memory leak when rmgr->rm_identify returns NULL.
This got broken in 604f795, shortly after rm_identify's introduction. Author: Andres Freund Discussion: https://postgr.es/m/20191029233341.4gnyau7e5v2lh5sc@alap3.anarazel.de Backpatch: 9.5, where rm_identify was introduced
1 parent 6ca86bb commit e0f76f2

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/bin/pg_waldump/pg_waldump.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -517,17 +517,18 @@ XLogDumpDisplayRecord(XLogDumpConfig *config, XLogReaderState *record)
517517

518518
XLogDumpRecordLen(record, &rec_len, &fpi_len);
519519

520-
id = desc->rm_identify(info);
521-
if (id == NULL)
522-
id = psprintf("UNKNOWN (%x)", info & ~XLR_INFO_MASK);
523-
524520
printf("rmgr: %-11s len (rec/tot): %6u/%6u, tx: %10u, lsn: %X/%08X, prev %X/%08X, ",
525521
desc->rm_name,
526522
rec_len, XLogRecGetTotalLen(record),
527523
XLogRecGetXid(record),
528524
(uint32) (record->ReadRecPtr >> 32), (uint32) record->ReadRecPtr,
529525
(uint32) (xl_prev >> 32), (uint32) xl_prev);
530-
printf("desc: %s ", id);
526+
527+
id = desc->rm_identify(info);
528+
if (id == NULL)
529+
printf("desc: UNKNOWN (%x) ", info & ~XLR_INFO_MASK);
530+
else
531+
printf("desc: %s ", id);
531532

532533
/* the desc routine will printf the description directly to stdout */
533534
desc->rm_desc(NULL, record);

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