Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
libotutil/checksum-utils: Fix memory management
Ostree uses the OtChecksum data structure as a wrapper around GChecksum (depending on what libraries are available at compile time). According to the docs for g_checksum_get_digest(), a GChecksum value can no longer be updated after that function is called. Ostree enforces this by setting "initialized" to FALSE after getting the digest, but this leads to ot_checksum_clear() avoiding freeing any memory, leading to leaks. So this commit adds a "closed" value that gets set when getting a digest and checked when updating the value, so the initialized value can be used only for memory management. Closes: #1521 Approved by: jlebon
- Loading branch information