ZooKeeper
  1. ZooKeeper
  2. ZOOKEEPER-1163

Memory leak in zk_hashtable.c:do_insert_watcher_object()

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.3.3
    • Fix Version/s: 3.3.6, 3.4.4, 3.5.0
    • Component/s: c client
    • Labels:
      None

      Description

      zk_hashtable.c:do_insert_watcher_object() line number 193 calls add_to_list with clone flag set to 1. This leaks memory, since the original watcher object was already allocated on the heap by activateWatcher() line 330.

      I will upload a patch shortly. The fix is to set clone flag to 0 in the call to add_to_list().

      1. zookeeper-1163.patch
        0.7 kB
        Anupam Chanda

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        305d 21m 1 Michi Mutsuzaki 25/Jun/12 18:09
        Hide
        Hudson added a comment -

        Integrated in ZooKeeper-trunk #1597 (See https://builds.apache.org/job/ZooKeeper-trunk/1597/)
        ZOOKEEPER-1163. Memory leak in zk_hashtable.c:do_insert_watcher_object() (Anupam Chanda via michim) (Revision 1353683)

        Result = SUCCESS
        michim : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1353683
        Files :

        • /zookeeper/trunk/CHANGES.txt
        • /zookeeper/trunk/src/c/src/zk_hashtable.c
        Show
        Hudson added a comment - Integrated in ZooKeeper-trunk #1597 (See https://builds.apache.org/job/ZooKeeper-trunk/1597/ ) ZOOKEEPER-1163 . Memory leak in zk_hashtable.c:do_insert_watcher_object() (Anupam Chanda via michim) (Revision 1353683) Result = SUCCESS michim : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1353683 Files : /zookeeper/trunk/CHANGES.txt /zookeeper/trunk/src/c/src/zk_hashtable.c
        Michi Mutsuzaki made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Michi Mutsuzaki made changes -
        Fix Version/s 3.3.6 [ 12320172 ]
        Fix Version/s 3.4.4 [ 12319841 ]
        Fix Version/s 3.5.0 [ 12316644 ]
        Hide
        Michi Mutsuzaki added a comment -

        +1.

        I'll check this in tomorrow unless there is objection. Thanks for the patch, Anupam!

        --Michi

        Show
        Michi Mutsuzaki added a comment - +1. I'll check this in tomorrow unless there is objection. Thanks for the patch, Anupam! --Michi
        Anupam Chanda made changes -
        Field Original Value New Value
        Attachment zookeeper-1163.patch [ 12491669 ]
        Anupam Chanda created issue -

          People

          • Assignee:
            Unassigned
            Reporter:
            Anupam Chanda
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development