Misc fixes (coverity)

This commit is contained in:
Nicolas Williams
2016-11-20 17:43:07 -06:00
parent 6696920d9e
commit f38089257b
19 changed files with 105 additions and 81 deletions

View File

@@ -1394,13 +1394,19 @@ json_db_open(void *plug, const char *dbtype, const char *dbname,
}
ret = read_json(dbname, (heim_object_t *)&contents, error);
if (ret)
if (ret) {
heim_release(bkpname_s);
heim_release(dbname_s);
return ret;
}
if (contents != NULL && heim_get_tid(contents) != HEIM_TID_DICT)
if (contents != NULL && heim_get_tid(contents) != HEIM_TID_DICT) {
heim_release(bkpname_s);
heim_release(dbname_s);
return HEIM_ERROR(error, EINVAL,
(EINVAL, N_("JSON DB contents not valid JSON",
"")));
}
}
jsondb = heim_alloc(sizeof (*jsondb), "json_db", NULL);