Skip to content

json_object_put: Assertion `jso->_ref_count > 0' failed #747

@CaledoniaProject

Description

@CaledoniaProject

Describe the bug
Trying to call put on all the json_object I've created, but fails with assertion error

Steps To Reproduce

According to the document I should call put on all objects, but it crashes:

struct json_object *obj_root, *obj_status;
obj_root = json_tokener_parse(input);
if (obj_root == NULL)
{
	return NULL;
}

obj_status = json_object_object_get(obj_root, "Status");
if (obj_status == NULL)
{
	return NULL;
}

json_object_put(obj_status);
json_object_put(obj_root);     // crashes here

Version and Platform

  • json-c version: 0.13.1
  • OS: Ubuntu 20.04

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions