Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
src/bundle: fix hash_index fd ownership handling
When calling r_hash_index_open(), the ownership of the file descriptor provided should be handed over to the hash index and will be later closed in r_hash_index_free(). Thus, the file descriptor provided must not be closed by the calling code anymore. In other code, this is done by setting data_fd = -1; after successfully opening the hash index. In generate_adaptive_data() however, this manual invalidation of the fd was missing and the fd was closed manually in later error handling. This could lead to cases where a double-call of g_close() on the same pointer happened. This was wrong anyway but results in a critical error in RAUC since glib version 2.75.0 which comes with a pickier g_close() handling: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2964 Fix this and add a hint to the function documentation. Signed-off-by: Enrico Joerns <[email protected]>
- Loading branch information