]> granicus.if.org Git - postgresql/commitdiff
libpq: Fix memory leak
authorPeter Eisentraut <peter_e@gmx.net>
Wed, 7 Mar 2012 21:35:03 +0000 (23:35 +0200)
committerPeter Eisentraut <peter_e@gmx.net>
Sat, 10 Mar 2012 22:47:36 +0000 (00:47 +0200)
If a client encoding is specified as a connection parameter (or
environment variable), internal storage allocated for it would never
be freed.

src/interfaces/libpq/fe-connect.c

index 2c3d544df727a42fb5a584ba3158df5c5adc16fb..704885bbbed20e0baa273110a44a6541c682d68d 100644 (file)
@@ -2744,6 +2744,8 @@ freePGconn(PGconn *conn)
                free(conn->events[i].name);
        }
 
+       if (conn->client_encoding_initial)
+               free(conn->client_encoding_initial);
        if (conn->events)
                free(conn->events);
        if (conn->pghost)