Fix possible resource leak (src/bin/pg_basebackup/pg_receivewal.c)
Started by Ranier Vilela11 months ago1 messages
Hi.
Per Coverity.
CID 1591288: (#1 of 1): Resource leak (RESOURCE_LEAK)
10. leaked_storage: Variable sysidentifier going out of scope leaks the
storage it points to.
Trivial patch attached.
best regards,
Ranier Vilela
Attachments:
fix-resource-leak-pg_receivewal.patchapplication/octet-stream; name=fix-resource-leak-pg_receivewal.patchDownload
diff --git a/src/bin/pg_basebackup/pg_receivewal.c b/src/bin/pg_basebackup/pg_receivewal.c
index 176c40faca..69d279edea 100644
--- a/src/bin/pg_basebackup/pg_receivewal.c
+++ b/src/bin/pg_basebackup/pg_receivewal.c
@@ -547,6 +547,7 @@ StreamLog(void)
if (!GetSlotInformation(conn, replication_slot, &stream.startpos,
&stream.timeline))
{
+ pg_free(sysidentifier);
/* Error is logged by GetSlotInformation() */
return;
}