summaryrefslogtreecommitdiff
path: root/ovsdb/execution.c
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2010-02-02 14:40:25 -0800
committerBen Pfaff <blp@nicira.com>2010-02-02 15:21:09 -0800
commite084f69017bc840cd7aed4cc9ed2e13f3fb6747e (patch)
treeae74e48e87a0d5cd88fecffff381f714278e84e4 /ovsdb/execution.c
parent65f92a50690e6f1dddbc11e95db7301343f1c018 (diff)
downloadopenvswitch-e084f69017bc840cd7aed4cc9ed2e13f3fb6747e.tar.gz
ovsdb-server: Fix various memory leaks.
Some of these are serious leaks, in that they could leak some amount of memory for every transaction processed by the database server. Found with valgrind.
Diffstat (limited to 'ovsdb/execution.c')
-rw-r--r--ovsdb/execution.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/ovsdb/execution.c b/ovsdb/execution.c
index 4cb8b14c4..514a27848 100644
--- a/ovsdb/execution.c
+++ b/ovsdb/execution.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009 Nicira Networks
+/* Copyright (c) 2009, 2010 Nicira Networks
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -161,9 +161,11 @@ ovsdb_execute(struct ovsdb *db, const struct json *params,
&& timeout_msec) {
ovsdb_txn_abort(x.txn);
*timeout_msec = x.timeout_msec;
- ovsdb_error_destroy(error);
+
+ json_destroy(result);
json_destroy(results);
- return NULL;
+ results = NULL;
+ goto exit;
}
/* Add result to array. */
@@ -186,6 +188,7 @@ ovsdb_execute(struct ovsdb *db, const struct json *params,
json_array_add(results, json_null_create());
}
+exit:
ovsdb_error_destroy(error);
ovsdb_symbol_table_destroy(x.symtab);