replace memcpy() with g_memdup()

Signed-off-by: Lehner Florian <dev@der-flo.net>