(read_bulletin_db): Do not close DB too early.
Showing
1 changed file
with
3 additions
and
2 deletions
... | @@ -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) | ... | ... |
-
Please register or sign in to post a comment