Created
December 3, 2012 10:49
-
-
Save breuderink/4194169 to your computer and use it in GitHub Desktop.
Memory leak with Jansson?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} |
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
any process ?