Coding style.
This returns an indexnode so it should be copied.

That copy, plus loads more, should be free()d.
Give this a more sensible name.
Start on the path of setters / adders don't take copies.
This is basically a tryGet and shouldn't return an allocated area unless it returns success.
Either use these (i.e. pass onto to the indexnode ctor) or free them! Because they've been passsed in they now belong to this function.

Also move the trace to somewhere those strings are still valid.