[ovs-dev] [PATCH] fix nx-match.c and execution.c memory leak find by the tool of fortify

\y00206114 yinpeijun at huawei.com
Wed Aug 27 01:52:54 UTC 2014


From: yinpeijun <yinpeijun at huawei.com>

Signed-off-by: yinpeijun <yinpeijun at huawei.com>
---
 lib/nx-match.c    | 1 +
 ovsdb/execution.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/lib/nx-match.c b/lib/nx-match.c
index 1d3205f..54712cc 100644
--- a/lib/nx-match.c
+++ b/lib/nx-match.c
@@ -109,6 +109,7 @@ check_mask_consistency(const uint8_t *p, const struct mf_field *mf)
                              "bits wildcarded by the mask.  (Future versions "
                              "of OVS may report this as an OpenFlow error.)",
                              s);
+                free(s);
                 break;
             }
         }
diff --git a/ovsdb/execution.c b/ovsdb/execution.c
index 7a1db0c..6314757 100644
--- a/ovsdb/execution.c
+++ b/ovsdb/execution.c
@@ -659,6 +659,7 @@ ovsdb_execute_wait(struct ovsdb_execution *x, struct ovsdb_parser *parser,
             error = ovsdb_row_from_json(row, rows->u.array.elems[i], x->symtab,
                                         NULL);
             if (error) {
+                ovsdb_row_destroy(row);
                 break;
             }
 
-- 
1.9.4.msysgit.0





More information about the dev mailing list