ofp-print: Fix memory leak at ofp_print_bundle_add().
authorWilliam Tu <u9012063@gmail.com>
Thu, 24 Dec 2015 18:28:40 +0000 (10:28 -0800)
committerBen Pfaff <blp@ovn.org>
Mon, 4 Jan 2016 20:35:32 +0000 (12:35 -0800)
commitcf8fbeaa1c876ac0af7acd59551bfd9b92b0bc3b
tree59bccca1e0b87c4fb89509270a4263a0eddcdfba
parent39cc5c4adea207465e88d309dedf61990201301b
ofp-print: Fix memory leak at ofp_print_bundle_add().

Call ds_put_and_free_cstr instead of ds_put_cstr to free msg.
Reported by test cases: 325, 326
    ofp_print_bundle_add (ofp-print.c:3027)
    ofp_to_string__ (ofp-print.c:3410)
    ofp_to_string (ofp-print.c:3465)
    ofp_print (ofp-print.c:3497)
    ofctl_ofp_print (ovs-ofctl.c:3818)
    ovs_cmdl_run_command (command-line.c:121)
    main (ovs-ofctl.c:135)

Signed-off-by: William Tu <u9012063@gmail.com>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Co-authored-by: Daniele Di Proietto <diproiettod@vmware.com>
[blp@ovn.org simplified the code slightly]
Signed-off-by: Ben Pfaff <blp@ovn.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
lib/ofp-print.c