[ovs-git] [openvswitch/ovs] ea11bb: ovsdb-idl: Fix memory leak of ovsdb_idl_db_clear.

Han Zhou noreply at github.com
Fri Mar 8 00:59:29 UTC 2019


  Branch: refs/heads/master
  Home:   https://github.com/openvswitch/ovs
  Commit: ea11bb064316ca3b93a6ff2445a3a3785389b9b5
      https://github.com/openvswitch/ovs/commit/ea11bb064316ca3b93a6ff2445a3a3785389b9b5
  Author: Han Zhou <hzhou8 at ebay.com>
  Date:   2019-03-07 (Thu, 07 Mar 2019)

  Changed paths:
    M lib/ovsdb-idl.c

  Log Message:
  -----------
  ovsdb-idl: Fix memory leak of ovsdb_idl_db_clear.

ovsdb_idl_row_destroy() doesn't free the memory of row structure itself.
This is because of the ovsdb change tracking feature: the deleted row
may be accessed in the current iteration of main loop. The function
ovsdb_idl_row_destroy_postprocess() is called at the end of
ovsdb_idl_run() to free the deleted rows that are not tracked; the
function ovsdb_idl_db_track_clear() is called (indirectly) by user
at the end of each main loop iteration to free the deleted rows that
are tracked. However, in ovsdb_idl_db_clear(), which may be called when
a session is reset, or when the idl is destroyed, it didn't call
ovsdb_idl_row_destroy_postprocess(), which would result in all the
untracked rows leaked. This patch fixes that.

Signed-off-by: Han Zhou <hzhou8 at ebay.com>
Signed-off-by: Ben Pfaff <blp at ovn.org>




More information about the git mailing list