Don't use a field before setting it
We are using the data->len field in our g_memdup() call before we're actually setting it; since the data structure is zero-filled, it means we're not copying the buffer at all.
We are using the data->len field in our g_memdup() call before we're actually setting it; since the data structure is zero-filled, it means we're not copying the buffer at all.