Skip to content

Instantly share code, notes, and snippets.

@breuderink
Created December 3, 2012 10:49
Show Gist options
  • Save breuderink/4194169 to your computer and use it in GitHub Desktop.
Save breuderink/4194169 to your computer and use it in GitHub Desktop.
Memory leak with Jansson?
float mp_detection(mp_response_t *response, const char *detector_name)
{
json_t *json;
json_error_t error;
float p;
if (!response->ready) {
return NAN;
}
json = json_loads(response->buffer, 0, &error);
if(!json) {
fprintf(stderr, "JSON Error: on line %d: %s!\n", error.line, error.text);
return NAN;
}
json = json_object_get(json, "detection");
json = json_object_get(json, detector_name);
p = json_real_value(json);
json_decref(json);
return p;
}
@zhangxinlong633
Copy link

any process ?

@breuderink
Copy link
Author

Sorry, I created this 8 year ago. I don't even remember what this was about. I think it was in this context: https://github.com/breuderink/idport-api/tree/master/c, but I don't remember if it was resolved in the end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment