ovsdb-server: Fix various memory leaks.
[sliver-openvswitch.git] / ovsdb / ovsdb.c
index 27254e6..e95d23c 100644 (file)
@@ -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.
@@ -68,8 +68,8 @@ ovsdb_schema_from_file(const char *file_name, struct ovsdb_schema **schemap)
     }
 
     error = ovsdb_schema_from_json(json, &schema);
+    json_destroy(json);
     if (error) {
-        json_destroy(json);
         return ovsdb_wrap_error(error,
                                 "failed to parse \"%s\" as ovsdb schema",
                                 file_name);