Commit a348e580 a348e580e9f2017cd792fc972b98ca27d4555007 by Sergey Poznyakoff

(read_bulletin_db): Do not close DB too early.

1 parent 00303eb7
...@@ -142,12 +142,12 @@ read_bulletin_db (size_t *pnum) ...@@ -142,12 +142,12 @@ read_bulletin_db (size_t *pnum)
142 MU_DATUM_SIZE(key) = strlen (username); 142 MU_DATUM_SIZE(key) = strlen (username);
143 143
144 rc = mu_dbm_fetch (db, key, &data); 144 rc = mu_dbm_fetch (db, key, &data);
145 mu_dbm_close (db);
146 145
147 if (rc) 146 if (rc)
148 { 147 {
149 mu_error (_("Cannot fetch bulletin db data: %s"), 148 mu_error (_("Cannot fetch bulletin db data: %s"),
150 mu_strerror (errno)); 149 mu_strerror (errno));
150 mu_dbm_close (db);
151 return 1; 151 return 1;
152 } 152 }
153 153
...@@ -168,7 +168,8 @@ read_bulletin_db (size_t *pnum) ...@@ -168,7 +168,8 @@ read_bulletin_db (size_t *pnum)
168 memcpy (bufptr, MU_DATUM_PTR (data), s); 168 memcpy (bufptr, MU_DATUM_PTR (data), s);
169 bufptr[s] = 0; 169 bufptr[s] = 0;
170 mu_dbm_datum_free(&data); 170 mu_dbm_datum_free(&data);
171 171 mu_dbm_close (db);
172
172 rc = 1; 173 rc = 1;
173 *pnum = strtoul (bufptr, &p, 0); 174 *pnum = strtoul (bufptr, &p, 0);
174 if (*p == 0) 175 if (*p == 0)
......