Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions dlg_wingui.c
Original file line number Diff line number Diff line change
Expand Up @@ -830,8 +830,10 @@ MYLOG(0, "entering\n");

void *PQconninfoParse(const char *, char **);
void PQconninfoFree(void *);
void PQfreemem(void *ptr);
typedef void *(*PQCONNINFOPARSEPROC)(const char *, char **);
typedef void (*PQCONNINFOFREEPROC)(void *);
typedef void (*PQFREEMEMPROC)(void *);
static int
ds_options3_update(HWND hdlg, ConnInfo *ci)
{
Expand All @@ -841,6 +843,7 @@ ds_options3_update(HWND hdlg, ConnInfo *ci)
HMODULE hmodule;
PQCONNINFOPARSEPROC pproc = NULL;
PQCONNINFOFREEPROC fproc = NULL;
PQFREEMEMPROC fmproc = NULL;

MYLOG(0, "entering got ci=%p\n", ci);

Expand All @@ -854,8 +857,10 @@ ds_options3_update(HWND hdlg, ConnInfo *ci)
const char *logmsg = "libpq parameter error";

MessageBox(hdlg, ermsg ? ermsg : "memory over?", logmsg, MB_ICONEXCLAMATION | MB_OK);
if (NULL != ermsg)
free(ermsg);
if (NULL != ermsg) {
fmproc = (PQFREEMEMPROC)GetProcAddress(hmodule, "PQfreemem");
(*fmproc)(ermsg);
}
FreeLibrary(hmodule);

return 1;
Expand Down