base: Fix use-after-free db.c (mostly unused in prod)
We only use `db` for an2ln testing.
This commit is contained in:
@@ -1505,11 +1505,12 @@ json_db_sync(void *db, heim_error_t *error)
|
|||||||
|
|
||||||
json = heim_json_copy_serialize(jsondb->dict, 0, &e);
|
json = heim_json_copy_serialize(jsondb->dict, 0, &e);
|
||||||
if (json == NULL) {
|
if (json == NULL) {
|
||||||
|
ret = heim_error_get_code(e);
|
||||||
if (error)
|
if (error)
|
||||||
*error = e;
|
*error = e;
|
||||||
else
|
else
|
||||||
heim_release(e);
|
heim_release(e);
|
||||||
return heim_error_get_code(e);
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
json_text = heim_string_get_utf8(json);
|
json_text = heim_string_get_utf8(json);
|
||||||
|
Reference in New Issue
Block a user