Bugfix
* pop3d/bulletin.c (read_bulletin_db): Fix memory/descriptor leak.
Showing
1 changed file
with
2 additions
and
1 deletions
... | @@ -137,6 +137,7 @@ read_bulletin_db (size_t *pnum) | ... | @@ -137,6 +137,7 @@ read_bulletin_db (size_t *pnum) |
137 | rc = mu_dbm_safety_check (db); | 137 | rc = mu_dbm_safety_check (db); |
138 | if (rc) | 138 | if (rc) |
139 | { | 139 | { |
140 | mu_dbm_destroy (&db); | ||
140 | if (rc == ENOENT) | 141 | if (rc == ENOENT) |
141 | { | 142 | { |
142 | *pnum = 0; | 143 | *pnum = 0; |
... | @@ -145,7 +146,6 @@ read_bulletin_db (size_t *pnum) | ... | @@ -145,7 +146,6 @@ read_bulletin_db (size_t *pnum) |
145 | mu_diag_output (MU_DIAG_ERROR, | 146 | mu_diag_output (MU_DIAG_ERROR, |
146 | _("bulletin db %s fails safety check: %s"), | 147 | _("bulletin db %s fails safety check: %s"), |
147 | bulletin_db_name, mu_strerror (rc)); | 148 | bulletin_db_name, mu_strerror (rc)); |
148 | mu_dbm_destroy (&db); | ||
149 | return 1; | 149 | return 1; |
150 | } | 150 | } |
151 | 151 | ||
... | @@ -167,6 +167,7 @@ read_bulletin_db (size_t *pnum) | ... | @@ -167,6 +167,7 @@ read_bulletin_db (size_t *pnum) |
167 | 167 | ||
168 | if (rc == MU_ERR_NOENT) | 168 | if (rc == MU_ERR_NOENT) |
169 | { | 169 | { |
170 | mu_dbm_destroy (&db); | ||
170 | *pnum = 0; | 171 | *pnum = 0; |
171 | return 0; | 172 | return 0; |
172 | } | 173 | } | ... | ... |
-
Please register or sign in to post a comment