pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Failure to exit critical section on error case
2+ messages / 2 participants
[nested] [flat]

* Failure to exit critical section on error case
@ 2015-06-15 08:14  Craig Ringer <craig@2ndquadrant.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Craig Ringer @ 2015-06-15 08:14 UTC (permalink / raw)
  To: pgsql-odbc

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;
    }



-- 
 Craig Ringer                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


-- 
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Failure to exit critical section on error case
@ 2015-06-23 13:51  Heikki Linnakangas <hlinnaka@iki.fi>
  parent: Craig Ringer <craig@2ndquadrant.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Heikki Linnakangas @ 2015-06-23 13:51 UTC (permalink / raw)
  To: Craig Ringer <craig@2ndquadrant.com>; pgsql-odbc

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



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2015-06-23 13:51 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-06-15 08:14 Failure to exit critical section on error case Craig Ringer <craig@2ndquadrant.com>
2015-06-23 13:51 ` Heikki Linnakangas <hlinnaka@iki.fi>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox