Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd431848

Browse files
committed
libpq: Fix minor memory leaks
When using connection info arrays with a conninfo string in the dbnameslot, some memory would be leaked if an error occurred whileprocessing the following array slots.found by Coverity
1 parent598bb8c commitd431848

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

‎src/interfaces/libpq/fe-connect.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4303,6 +4303,7 @@ conninfo_array_parse(const char *const * keywords, const char *const * values,
43034303
{
43044304
printfPQExpBuffer(errorMessage,
43054305
libpq_gettext("out of memory\n"));
4306+
PQconninfoFree(str_options);
43064307
returnNULL;
43074308
}
43084309
memcpy(options,PQconninfoOptions,sizeof(PQconninfoOptions));
@@ -4330,6 +4331,7 @@ conninfo_array_parse(const char *const * keywords, const char *const * values,
43304331
libpq_gettext("invalid connection option \"%s\"\n"),
43314332
pname);
43324333
PQconninfoFree(options);
4334+
PQconninfoFree(str_options);
43334335
returnNULL;
43344336
}
43354337

@@ -4374,6 +4376,7 @@ conninfo_array_parse(const char *const * keywords, const char *const * values,
43744376
printfPQExpBuffer(errorMessage,
43754377
libpq_gettext("out of memory\n"));
43764378
PQconninfoFree(options);
4379+
PQconninfoFree(str_options);
43774380
returnNULL;
43784381
}
43794382
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp