forked from openvswitch/ovs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ofp-util: Make decoding switch features harder to misuse (and fix leak).
Until now, ofputil_decode_switch_features() has put the ports from the switch features message into a separate ofpbuf supplied as an argument. The natural desire for a caller is to just reuse an ofpbuf that it already has, and that's what one of the callers did. This however has the nonobvious effect of leaking the memory that the ofpbuf previously owned, since it gets replaced by an OFPBUF_CONST-type ofpbuf. This commit avoids the problem by changing the interface to pull the header from an ofpbuf that the caller already has. This fixes a leak in testcase 909 "ofproto-dpif - patch ports". Found by valgrind. Reported-by: William Tu <[email protected]> Reported-at: http://openvswitch.org/pipermail/dev/2016-January/064771.html Signed-off-by: Ben Pfaff <[email protected]> Acked-by: Andy Zhou <[email protected]>
- Loading branch information
Showing
5 changed files
with
17 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters