]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
modules/hints: plug a memory leak in .use_nodata()
authorVladimír Čunát <vladimir.cunat@nic.cz>
Wed, 9 Jan 2019 13:53:14 +0000 (14:53 +0100)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Wed, 9 Jan 2019 14:46:12 +0000 (15:46 +0100)
It was tiny, but still.

modules/hints/hints.c

index e5d86dbaecfe258678a46a29dffbd5168c0b50a0..84e2e990196ee4759a82f71b160b43acad405b07 100644 (file)
@@ -561,10 +561,12 @@ static char* hint_use_nodata(void *env, struct kr_module *module, const char *ar
 
        JsonNode *root_node = json_decode(args);
        if (!root_node || root_node->tag != JSON_BOOL) {
+               json_delete(root_node);
                return bool2jsonstr(false);
        }
 
        data->use_nodata = root_node->bool_;
+       json_delete(root_node);
        return bool2jsonstr(true);
 }