BIND 10 #2821: MySQLLeaseManager does not close db if constructor fails

BIND 10 Development do-not-reply at isc.org
Mon Feb 25 16:22:14 UTC 2013


#2821: MySQLLeaseManager does not close db if constructor fails
-------------------------------------+-------------------------------------
                   Reporter:  jelte  |                 Owner:
                       Type:         |                Status:  new
  defect                             |             Milestone:  New Tasks
                   Priority:         |              Keywords:
  medium                             |             Sensitive:  0
                  Component:         |           Sub-Project:  DNS
  Unclassified                       |  Estimated Difficulty:  0
               CVSS Scoring:         |           Total Hours:  0
            Defect Severity:  N/A    |
Feature Depending on Ticket:         |
        Add Hours to Ticket:  0      |
                  Internal?:  0      |
-------------------------------------+-------------------------------------
 This looks like it is currently the last issue that makes the valgrind bot
 fail, and I would like to fix this before other issues crop up again (so
 that we can finally address new valgrind issues in the tickets that cause
 them).

 The MySQLLeaseMgr class holds a pointer to an open database connection,
 which is closed when an instance is destroyed. However, during
 initialization several internal calls are made and if any of those (and
 hence construction) fails the database is not closed.

 I have a fix, which is partly the Right Approach but also partly path of
 least resistance (it introduces an RAII-style object but only uses it in
 the constructor for now, and not in any calls it makes or the main class
 itself), because I did not want to touch too much code.

 I'll push it to a branch as soon as trac gives me a ticket number.

-- 
Ticket URL: <http://bind10.isc.org/ticket/2821>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development


More information about the bind10-tickets mailing list