Protect shared connection list when making cleanup tasks in EN_Destructor
authorHiroshi Inoue <inoue@tpf.co.jp>
Sat, 16 Feb 2013 12:58:00 +0000 (12:58 +0000)
committerHiroshi Inoue <inoue@tpf.co.jp>
Sat, 16 Feb 2013 12:58:00 +0000 (12:58 +0000)
using the patch provided by Michael Kocherov.

environ.c

index 87e25d0118f1c0d8ba87c9b46a8fabf42b9aa29a..8a242936c694a1ffffc91904779245dc04df03c0 100644 (file)
--- a/environ.c
+++ b/environ.c
@@ -583,6 +583,7 @@ EN_Destructor(EnvironmentClass *self)
     */
 
    /* Free any connections belonging to this environment */
+   ENTER_CONNS_CS;
    for (lf = 0, nullcnt = 0; lf < conns_count; lf++)
    {
        if (NULL == conns[lf])
@@ -603,6 +604,7 @@ EN_Destructor(EnvironmentClass *self)
        conns = NULL;
        conns_count = 0;
    }
+   LEAVE_CONNS_CS;
    DELETE_ENV_CS(self);
    free(self);