[ovs-git] [openvswitch/ovs] a7a43b: ofproto: Fix memory leak and memory exhaustion bug...

GitHub noreply at github.com
Wed Jan 20 06:45:52 UTC 2016


  Branch: refs/heads/branch-2.4
  Home:   https://github.com/openvswitch/ovs
  Commit: a7a43b4361b0ecf504308ae9fc764b852420758d
      https://github.com/openvswitch/ovs/commit/a7a43b4361b0ecf504308ae9fc764b852420758d
  Author: Ben Pfaff <blp at ovn.org>
  Date:   2016-01-19 (Tue, 19 Jan 2016)

  Changed paths:
    M ofproto/ofproto.c

  Log Message:
  -----------
  ofproto: Fix memory leak and memory exhaustion bugs in group_mod.

In handle_group_mod() cases where adding a group failed, nothing freed the
list of buckets, causing a leak.  The same was true in every case of
modifying a group.  This commit fixes the problem by changing add_group()
to never steal or free the buckets (modify_group() already acted this way)
and then making handle_group_mod() always free the buckets when it's done.

This approach might at first raise objections, because it makes add_group()
copy the buckets instead of just take the existing ones.  On branch-2.5
and master, there's a good reason for that--please see the original commit
for explanation.  On this backport to branch-2.4, though, we just use this
approach to avoid having to carefully write a new version for the backport.

Found by pain and suffering.

Signed-off-by: Ben Pfaff <blp at ovn.org>
Acked-by: Jarno Rajahalme <jarno at ovn.org>




More information about the git mailing list