Commit fbcf481e fbcf481ed5816ccc2d84c9a0f0214f0c8c73f8c9 by Sergey Poznyakoff

Bugfix

* pop3d/bulletin.c (read_bulletin_db): Fix memory/descriptor leak.
1 parent d2cfcaca
...@@ -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 }
......