diff --git a/lib/base/db.c b/lib/base/db.c index b206ff6d7..794b12bbb 100644 --- a/lib/base/db.c +++ b/lib/base/db.c @@ -1505,11 +1505,12 @@ json_db_sync(void *db, heim_error_t *error) json = heim_json_copy_serialize(jsondb->dict, 0, &e); if (json == NULL) { + ret = heim_error_get_code(e); if (error) *error = e; else heim_release(e); - return heim_error_get_code(e); + return ret; } json_text = heim_string_get_utf8(json);