The line g_graph.adj = malloc(sizeof(Vertex *))
only allocates space for one Vertex
pointer. As soon as you do vlist++
, you move into unallocated space, and any use of that space is undefined.
You'll need to change that first malloc call to malloc(sizeof(Vertex *) * vertex_count)
to properly allocate the space.