1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

libpq: Fix memory leak in URI parser

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

found by Coverity
This commit is contained in:
Peter Eisentraut
2012-08-23 22:33:04 -04:00
parent f3df4cd22c
commit 1c8c084cdc

View File

@ -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)