ZooKeeper
  1. ZooKeeper
  2. ZOOKEEPER-898

C Client might not cleanup correctly during close

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.3.2, 3.4.0
    • Component/s: c client
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      I was looking through the c-client code and noticed a situation where a counter can be incorrectly incremented and a small memory leak can occur.

      In zookeeper.c : add_completion(), if close_requested is true, then the completion will not be queued. But at the end, outstanding_sync is still incremented and free() never called on the newly allocated completion_list_t.

      I will submit for review a diff that I believe corrects this issue.

      1. ZOOKEEEPER-898.diff
        0.6 kB
        Jared Cantwell
      2. ZOOKEEPER-898.patch
        0.7 kB
        Jared Cantwell

        Activity

        Hide
        Hudson added a comment -

        Integrated in ZooKeeper-trunk #983 (See https://hudson.apache.org/hudson/job/ZooKeeper-trunk/983/)
        ZOOKEEPER-898. C Client might not cleanup correctly during close (jared cantwell via mahadev)

        Show
        Hudson added a comment - Integrated in ZooKeeper-trunk #983 (See https://hudson.apache.org/hudson/job/ZooKeeper-trunk/983/ ) ZOOKEEPER-898 . C Client might not cleanup correctly during close (jared cantwell via mahadev)
        Hide
        Mahadev konar added a comment -

        +1, good catch jared. I just committed this to 3.3 and trunk.

        thanks!

        Show
        Mahadev konar added a comment - +1, good catch jared. I just committed this to 3.3 and trunk. thanks!
        Hide
        Jared Cantwell added a comment -

        Updated patch format and spelling.

        Show
        Jared Cantwell added a comment - Updated patch format and spelling.
        Hide
        Jared Cantwell added a comment -

        Suggested correction.

        Show
        Jared Cantwell added a comment - Suggested correction.

          People

          • Assignee:
            Jared Cantwell
            Reporter:
            Jared Cantwell
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development