The GError object has to initialized to NULL before being passed to
g_file_set_contents or it will throw the following critical warning
GLib-CRITICAL **: g_file_set_contents: assertion 'error == NULL || *error == NULL' failed
and return FALSE, which leads to failed assertion and subsequently
to the test failing
void srtest_buf_to_file(const char *filename, const uint8_t *buf, uint64_t len)
{
FILE *f;
- GError *error;
+ GError *error = NULL;
gboolean ret;
f = g_fopen(filename, "wb");