The function given to g_array_set_clear_func() for clearing server arrays gets a pointer to server pointer as a parameter instead of simply pointer to server structure. This change adds a wrapper function removing one level of indirection. Before this change, when arrays are freed, the serve_dec_ref() would decrement random stuff in memory and rarely call free() to some random memory address, crashing nbd-server.
The function given to g_array_set_clear_func() for clearing server arrays gets a pointer to server pointer as a parameter instead of simply pointer to server structure. This change adds a wrapper function removing one level of indirection. Before this change, when arrays are freed, the serve_dec_ref() would decrement random stuff in memory and rarely call free() to some random memory address, crashing nbd-server.