diff options
author | Christian Grothoff <christian@grothoff.org> | 2021-06-15 20:34:25 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2021-06-15 20:34:25 +0200 |
commit | 2918448338647659e899d485acc659ab095be51c (patch) | |
tree | c057a45e5d47b2be3800026d77662a94c8c2d22a /src/json/json.c | |
parent | fa330ca12a3f660dbcb20de681043d79efd6ffb5 (diff) | |
download | exchange-2918448338647659e899d485acc659ab095be51c.tar.xz |
purge fields instead of setting to NULL as suggested by Florian
Diffstat (limited to 'src/json/json.c')
-rw-r--r-- | src/json/json.c | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/src/json/json.c b/src/json/json.c index 2c3d4a2c0..c480d1b2e 100644 --- a/src/json/json.c +++ b/src/json/json.c @@ -206,16 +206,8 @@ forget (const json_t *in) json_object_get (rx, key)) ) { - if (0 != - json_object_set_new (ret, - key, - json_null ())) - { - GNUNET_break (0); - json_decref (ret); - json_decref (rx); - return NULL; - } + (void) json_object_del (ret, + key); continue; /* already forgotten earlier */ } t = forget (value); @@ -281,16 +273,6 @@ forget (const json_t *in) json_decref (rx); return NULL; } - if (0 != - json_object_set_new (ret, - key, - json_null ())) - { - GNUNET_break (0); - json_decref (ret); - json_decref (rx); - return NULL; - } } else { |