Commit 4faf074a authored by Peter Eisentraut's avatar Peter Eisentraut

libpq: Fix memory leak in URI parser

When an invalid query parameter is reported, some memory leaks.

found by Coverity
parent ec8a0135
...@@ -4879,6 +4879,11 @@ conninfo_uri_parse_params(char *params, ...@@ -4879,6 +4879,11 @@ conninfo_uri_parse_params(char *params,
libpq_gettext( libpq_gettext(
"invalid URI query parameter: \"%s\"\n"), "invalid URI query parameter: \"%s\"\n"),
keyword); keyword);
if (malloced)
{
free(keyword);
free(value);
}
return false; return false;
} }
if (malloced) if (malloced)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment