> In my opinion the problem is here: > alias = (alias_t *)&reqc->aliases->elts[k]; > > Try > > alias = ((alias_t *)reqc->aliases->elts)[k]; >
Sorry alias = &((alias_t *)reqc->aliases->elts)[k]; or equivalently alias = ((alias_t *)reqc->aliases->elts) + k;