Merge pull request #626 from akheron/fix-example

Add a missing json_decref in the example
This commit is contained in:
Petri Lehtinen 2022-08-09 22:05:05 +03:00 committed by GitHub
commit 011e625769
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -153,6 +153,7 @@ int main(int argc, char *argv[]) {
sha = json_object_get(data, "sha"); sha = json_object_get(data, "sha");
if (!json_is_string(sha)) { if (!json_is_string(sha)) {
fprintf(stderr, "error: commit %d: sha is not a string\n", (int)(i + 1)); fprintf(stderr, "error: commit %d: sha is not a string\n", (int)(i + 1));
json_decref(root);
return 1; return 1;
} }