OSDN Git Service

Fix memory leak when using gsslib parameter in libpq connections
authorMagnus Hagander <magnus@hagander.net>
Thu, 23 Oct 2008 16:17:19 +0000 (16:17 +0000)
committerMagnus Hagander <magnus@hagander.net>
Thu, 23 Oct 2008 16:17:19 +0000 (16:17 +0000)
src/interfaces/libpq/fe-connect.c

index 0d2ec1d..54aa710 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/interfaces/libpq/fe-connect.c,v 1.362 2008/09/22 14:21:44 tgl Exp $
+ *       $PostgreSQL: pgsql/src/interfaces/libpq/fe-connect.c,v 1.363 2008/10/23 16:17:19 mha Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -2015,6 +2015,10 @@ freePGconn(PGconn *conn)
        if (conn->krbsrvname)
                free(conn->krbsrvname);
 #endif
+#if defined(ENABLE_GSS) && defined(ENABLE_SSPI)
+       if (conn->gsslib)
+               free(conn->gsslib);
+#endif
        /* Note that conn->Pfdebug is not ours to close or free */
        if (conn->last_query)
                free(conn->last_query);