dpif-netdev: Properly track whether there is a vlan header.
[openvswitch] / lib / json.c
index 0339a368d960268981810677f1f0d2bd913d197f..d26c89ed1c4535183ccf50ce12d328bf4716d29e 100644 (file)
@@ -277,7 +277,7 @@ json_real_create(double real)
 void
 json_object_put(struct json *json, const char *name, struct json *value)
 {
-    shash_add(json->u.object, name, value);
+    json_destroy(shash_replace(json->u.object, name, value));
 }
 
 void
@@ -832,7 +832,7 @@ json_string_unescape(const char *in, size_t in_len, char **outp)
     while (in < end) {
         if (*in == '"') {
             ds_clear(&out);
-            ds_put_cstr(&out, "quoted string may not include unescape \"");
+            ds_put_cstr(&out, "quoted string may not include unescaped \"");
             goto exit;
         }
         if (*in != '\\') {
@@ -1213,6 +1213,7 @@ json_parser_push(struct json_parser *p,
         p->parse_state = new_state;
         return node;
     } else {
+        json_destroy(new_json);
         json_error(p, "input exceeds maximum nesting depth %d",
                    JSON_MAX_HEIGHT);
         return NULL;