Here:
set *src = (set*)malloc(sizeof(set));
you are redeclaring src
(in a block scope), you want:
src = malloc(sizeof(set));
I could set it a constant size, but I don't really wanna go around this problem because I've had it in previous projects.
An alternative to realloc
when you don't know the size beforehand is a linked list.