Skip site navigation (1) Skip section navigation (2)

[PATCH] initialize pgconn to null

From: "Scot Loach" <sloach(at)sandvine(dot)com>
To: <pgsql-odbc(at)postgresql(dot)org>
Subject: [PATCH] initialize pgconn to null
Date: 2005-10-25 01:29:10
Message-ID: 71837C040963F748B9B94E123A289678E32637@mailserver.sandvine.com (view raw or flat)
Thread:
Lists: pgsql-odbc
This patch fixes a potential segfault that can happen if a dbc handle is created and then destroyed without attempting a connection.

The problem is that CC_Constructor doesn't initialize this new member variable.

--- connection.c.old    2005-10-24 21:23:55.000000000 -0400
+++ connection.c        2005-10-24 21:16:39.000000000 -0400
@@ -2443,6 +2443,7 @@
                rv->current_schema = NULL;
                rv->num_discardp = 0;
                rv->discardp = NULL;
+                rv->pgconn = NULL;

                /* Initialize statement options to defaults */
                /* Statements under this conn will inherit these options */


pgsql-odbc by date

Next:From: Dave PageDate: 2005-10-25 07:35:35
Subject: Re: [PATCH] initialize pgconn to null
Previous:From: Greg CampbellDate: 2005-10-21 15:12:12
Subject: Re: versions of oDBC driver

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group