config_file: fix cast of readonly backend In `backend_readonly_free`, the passed in config backend is being cast to a `diskfile_backend` instead of to a `diskfile_readonly_backend`. While this works out just fine because we only access its header values, which were shared between both backends, it is undefined behaviour. Use the correct type to fix this.
diff --git a/src/config_file.c b/src/config_file.c
index 31b311f..448d7bf 100644
--- a/src/config_file.c
+++ b/src/config_file.c
@@ -625,7 +625,7 @@ static int config_unlock_readonly(git_config_backend *_cfg, int success)
static void backend_readonly_free(git_config_backend *_backend)
{
- diskfile_backend *backend = GIT_CONTAINER_OF(_backend, diskfile_backend, parent);
+ diskfile_readonly_backend *backend = GIT_CONTAINER_OF(_backend, diskfile_readonly_backend, parent);
if (backend == NULL)
return;