the previously sent "factor out pg_malloc and friends" patch
may call exit() in case of OOM during allocation and as a consequence,
PQfinish() won't get called, leaving an "unexpected EOF from client"
in the log.
Let's close this annoyance in pg_basebackup. The attached patch does
- adds a PQfinish() (actually PQfinishSafe()) call that was just posted
in another thread
- replace all PQfinish() and PQclear() with their *Safe counterpart so
a normal execution won't result in a crash because of calling PQfinish()
on a stale pointer
- kill the disconnect_and_exit() macro, replace it with plain exit(),
the atexit callback does the disconnect anyway.
Cybertec Schönig & Schönig GmbH
A-2700 Wiener Neustadt, Austria
pgsql-hackers by date
|Next:||From: Heikki Linnakangas||Date: 2013-01-02 16:20:21|
|Subject: Re: Minor fix in 'clean' action of 'src/backend/Makefile'|
|Previous:||From: Fabrízio de Royes Mello||Date: 2013-01-02 16:05:17|
|Subject: Minor fix in 'clean' action of 'src/backend/Makefile'|