File tree 2 files changed +8
-6
lines changed
2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -431,10 +431,12 @@ pgthreadlock_t pg_g_threadlock = default_threadlock;
431
431
void
432
432
pqDropConnection (PGconn * conn , bool flushInput )
433
433
{
434
- /* Release compression streams */
435
- zpq_free (conn -> zstream );
436
- conn -> zstream = NULL ;
437
-
434
+ if (conn -> zstream )
435
+ {
436
+ /* Release compression streams */
437
+ zpq_free (conn -> zstream );
438
+ conn -> zstream = NULL ;
439
+ }
438
440
/* Drop any SSL state */
439
441
pqsecure_close (conn );
440
442
Original file line number Diff line number Diff line change @@ -898,7 +898,7 @@ pqSendSome(PGconn *conn, int len)
898
898
}
899
899
900
900
/* while there's still data to send */
901
- while (len > 0 || zpq_buffered (conn -> zstream ))
901
+ while (len > 0 || ( conn -> zstream && zpq_buffered (conn -> zstream ) ))
902
902
{
903
903
int sent ;
904
904
size_t processed = 0 ;
@@ -964,7 +964,7 @@ pqSendSome(PGconn *conn, int len)
964
964
remaining -= sent ;
965
965
}
966
966
967
- if (len > 0 || sent < 0 || zpq_buffered (conn -> zstream ))
967
+ if (len > 0 || sent < 0 || ( conn -> zstream && zpq_buffered (conn -> zstream ) ))
968
968
{
969
969
/*
970
970
* We didn't send it all, wait till we can send more.
You can’t perform that action at this time.
0 commit comments