Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Z7OcJ-0001a2-PQ for pgsql-odbc@arkaria.postgresql.org; Tue, 23 Jun 2015 13:51:59 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1Z7OcI-00088F-Fs for pgsql-odbc@arkaria.postgresql.org; Tue, 23 Jun 2015 13:51:58 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1Z7Oc9-0007xk-Tw for pgsql-odbc@postgresql.org; Tue, 23 Jun 2015 13:51:50 +0000 Received: from mail-pd0-x229.google.com ([2607:f8b0:400e:c02::229]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1Z7Oc5-00077G-Q1 for pgsql-odbc@postgresql.org; Tue, 23 Jun 2015 13:51:48 +0000 Received: by pdbci14 with SMTP id ci14so7820130pdb.2 for ; Tue, 23 Jun 2015 06:51:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:reply-to:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=+tFxYU5+lEvvuumYTE8LT+qf0/84sNcP2qu/yYj75ac=; b=bRj2QUPOVobMC3TfWvFph5+duCugsdSMF4giabXHeCwwXIYXlw3URDoB3eJlISyfmf Jw9gxVFJd3iHpd4Wsvhy4FcH2yUDBNTYBx+iBU7m9BzvavfthR7sGeLAEe3lVmoL79Qc +Oubp+acDkfTaIor8Wm99zVEiWjNesLohmpYUBUWPDPOlHWJmuPpq8CO6j+zEMAQtJHR G6fqWaN/SHXLzORuPvPUeCZVntJ+GObptd+D7hiplucsekZUtE9T7Wdjye3kw4espIj/ /W2ZvGYVhVIz5MNWyDjfd4PKX7IC/31GXCX06Hk1+UHpO/MY7Q+ZnZfl33YukGHKle8k lQvg== X-Received: by 10.68.204.133 with SMTP id ky5mr69594331pbc.67.1435067504414; Tue, 23 Jun 2015 06:51:44 -0700 (PDT) Received: from [192.168.1.104] (dsl-hkibrasgw1-58c38f-82.dhcp.inet.fi. [88.195.143.82]) by mx.google.com with ESMTPSA id h11sm23420324pdj.27.2015.06.23.06.51.42 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Jun 2015 06:51:43 -0700 (PDT) Message-ID: <5589646B.2090709@iki.fi> Date: Tue, 23 Jun 2015 16:51:39 +0300 From: Heikki Linnakangas Reply-To: hlinnaka@iki.fi User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.7.0 MIME-Version: 1.0 To: Craig Ringer , pgsql-odbc@postgresql.org Subject: Re: Failure to exit critical section on error case References: In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.7 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-odbc Precedence: bulk Sender: pgsql-odbc-owner@postgresql.org On 06/15/2015 11:14 AM, Craig Ringer wrote: > Hi all > > A user pointed out that after line 130 in pgxalib.c: > > 122 HDBC XAConnection::ActivateConnection(void) > 123 { > 124 RETCODE ret; > 125 > 126 MLOCK_ACQUIRE; > 127 if (!init_crit.env) > 128 { > 129 ret = SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, > &init_crit.env); > 130 if (!SQL_SUCCEEDED(ret)) > 131 return NULL; > 132 } > 133 MLOCK_RELEASE; > > we fail to MLOCK_RELEASE . > > It seems like a trivial fix to just > > if (!SQL_SUCCEEDED(ret)) > { > MLOCK_RELEASE; > return NULL; > } > Fixed, thanks. - Heikki -- Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-odbc