[PATCH] Resource leaks (src/backend/libpq/hba.c) - Mailing list pgsql-hackers

From Ranier Vilela
Subject [PATCH] Resource leaks (src/backend/libpq/hba.c)
Date
Msg-id CAEudQAo3Zamas2S=A8mRBJOBAyyn5Vg1FukGT=M8yZEvC8XfVA@mail.gmail.com
Whole thread Raw
Responses Re: [PATCH] Resource leaks (src/backend/libpq/hba.c)
List pgsql-hackers
Hi Tom,

Per Coverity.

The function parse_hba_auth_op at (src/backend/libpq/hba.c) allows resource leaks when called
by the function parse_hba_line, with parameters LOG and DEBUG3 levels.

The function SplitGUCList (src/bin/pg_dump/dumputils.c) allows even returning FALSE,
that namelist list is not empty and as memory allocated by pg_malloc.

The simplest solution is free namelist, even when calling ereport, why the level can be
LOG or DEBUG3.

regards,
Ranier Vilela

PS. Are two SplitGUCList in codebase.
1. SplitGUCList (src/bin/pg_dump/dumputils.c)
2. SplitGUCList (src/backend/utils/adt/varlena.c)
Attachment

pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: Fix a couple of misuages of bms_num_members()
Next
From: Stephen Frost
Date:
Subject: Re: Problems with the FSM, heap fillfactor, and temporal locality