mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-09-06 15:29:21 +02:00
pg_waldump: Fix small memory leak when rmgr->rm_identify returns NULL.
This got broken in 604f7956b9
, 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
This commit is contained in:
parent
eae1ba65fa
commit
4ab353c477
@ -533,16 +533,17 @@ XLogDumpDisplayRecord(XLogDumpConfig *config, XLogReaderState *record)
|
|||||||
|
|
||||||
XLogDumpRecordLen(record, &rec_len, &fpi_len);
|
XLogDumpRecordLen(record, &rec_len, &fpi_len);
|
||||||
|
|
||||||
id = desc->rm_identify(info);
|
|
||||||
if (id == NULL)
|
|
||||||
id = psprintf("UNKNOWN (%x)", info & ~XLR_INFO_MASK);
|
|
||||||
|
|
||||||
printf("rmgr: %-11s len (rec/tot): %6u/%6u, tx: %10u, lsn: %X/%08X, prev %X/%08X, ",
|
printf("rmgr: %-11s len (rec/tot): %6u/%6u, tx: %10u, lsn: %X/%08X, prev %X/%08X, ",
|
||||||
desc->rm_name,
|
desc->rm_name,
|
||||||
rec_len, XLogRecGetTotalLen(record),
|
rec_len, XLogRecGetTotalLen(record),
|
||||||
XLogRecGetXid(record),
|
XLogRecGetXid(record),
|
||||||
(uint32) (record->ReadRecPtr >> 32), (uint32) record->ReadRecPtr,
|
(uint32) (record->ReadRecPtr >> 32), (uint32) record->ReadRecPtr,
|
||||||
(uint32) (xl_prev >> 32), (uint32) xl_prev);
|
(uint32) (xl_prev >> 32), (uint32) xl_prev);
|
||||||
|
|
||||||
|
id = desc->rm_identify(info);
|
||||||
|
if (id == NULL)
|
||||||
|
printf("desc: UNKNOWN (%x) ", info & ~XLR_INFO_MASK);
|
||||||
|
else
|
||||||
printf("desc: %s ", id);
|
printf("desc: %s ", id);
|
||||||
|
|
||||||
/* the desc routine will printf the description directly to stdout */
|
/* the desc routine will printf the description directly to stdout */
|
||||||
|
Loading…
Reference in New Issue
Block a user