Fix memory leaks in error paths.
authoryinpeijun <yinpeijun@huawei.com>
Wed, 27 Aug 2014 01:52:54 +0000 (09:52 +0800)
committerBen Pfaff <blp@nicira.com>
Wed, 27 Aug 2014 14:42:24 +0000 (07:42 -0700)
Found by Fortify.

Signed-off-by: yinpeijun <yinpeijun@huawei.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
lib/nx-match.c
ovsdb/execution.c

index 295eec0..ff77422 100644 (file)
@@ -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;
             }
         }
index 7a1db0c..6314757 100644 (file)
@@ -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;
             }