If the rela2 NULL initialization is just a one-time thing, can you put it before the loop starts?  I think that would make the code a lot clearer.