summaryrefslogtreecommitdiff
path: root/ovsdb
diff options
context:
space:
mode:
authorYifeng Sun <pkusunyifeng@gmail.com>2017-11-20 04:26:38 -0800
committerBen Pfaff <blp@ovn.org>2017-11-29 13:35:22 -0800
commit38272efe9f349f822611a4808b58a400bf0ac5bf (patch)
tree4b7b9829262db69cc9d81ab18519fc28f1b0040c /ovsdb
parent14fae3e09341c8bf45818530c98fce1237d42dcc (diff)
downloadopenvswitch-38272efe9f349f822611a4808b58a400bf0ac5bf.tar.gz
execution: Fix bug that leaks ovsdb_row
If there is an error after ovsdb_rbac_insert, 'row' is leaked. So move the existing ovsdb_row_destroy to the function end. Signed-off-by: Yifeng Sun <pkusunyifeng@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'ovsdb')
-rw-r--r--ovsdb/execution.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ovsdb/execution.c b/ovsdb/execution.c
index 1ebe7a772..016b9c687 100644
--- a/ovsdb/execution.c
+++ b/ovsdb/execution.c
@@ -348,7 +348,6 @@ ovsdb_execute_insert(struct ovsdb_execution *x, struct ovsdb_parser *parser,
if (datum->n == 1) {
error = ovsdb_datum_check_constraints(datum, &column->type);
if (error) {
- ovsdb_row_destroy(row);
break;
}
}
@@ -367,6 +366,8 @@ ovsdb_execute_insert(struct ovsdb_execution *x, struct ovsdb_parser *parser,
json_object_put(result, "uuid",
ovsdb_datum_to_json(&row->fields[OVSDB_COL_UUID],
&ovsdb_type_uuid));
+ } else {
+ ovsdb_row_destroy(row);
}
return error;
}