diff mbox

[ovs-dev] ofp-util: fix memory leak in ofputil_pull_ofp11_buckets

Message ID 1498641281-12500-1-git-send-email-zhongbaisong@huawei.com
State Accepted
Headers show

Commit Message

zhongbaisong June 28, 2017, 9:14 a.m. UTC
Signed-off-by: zhongbaisong <zhongbaisong@huawei.com>
---
 lib/ofp-util.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Ben Pfaff July 7, 2017, 6:14 p.m. UTC | #1
On Wed, Jun 28, 2017 at 05:14:41PM +0800, zhongbaisong wrote:
> Signed-off-by: zhongbaisong <zhongbaisong@huawei.com>

Thanks for the fix!  I applied this to master and backported as far as
branch-2.2.
diff mbox

Patch

diff --git a/lib/ofp-util.c b/lib/ofp-util.c
index 0c768ae..9e008aa 100644
--- a/lib/ofp-util.c
+++ b/lib/ofp-util.c
@@ -9206,6 +9206,7 @@  ofputil_pull_ofp11_buckets(struct ofpbuf *msg, size_t buckets_length,
         if (error) {
             ofpbuf_uninit(&ofpacts);
             ofputil_bucket_list_destroy(buckets);
+            free(bucket);
             return OFPERR_OFPGMFC_BAD_WATCH;
         }
         bucket->watch_group = ntohl(ob->watch_group);