This thing still has me hung up.

When the program exits out of lookup(alphalist *index, char *word, wordlist **position), it does return a memory location, but not the one that I set it equal to inside of the lookup function. All the printfs are there for my debugging. An example of the incorrect location assignment from my debug printf statements:
Position for word blue: 136452
test: 136452
Position2: 136592
I know I must be doing one stupid little thing wrong here. Any help would be greatly appreciated! Thanks.
void incr_freq(alphalist *index, char *word)
{
int wordfreq;
wordlist *temp = NULL;
wordlist *position2;
position2 = (wordlist *) malloc(sizeof (wordlist));
wordfreq = lookup(index, word, &position2);
printf("Position2: %d\n", position2); //debug
if (wordfreq > 0)
position2->freq = wordfreq + 1;
else
temp = (wordlist *) malloc(sizeof (wordlist));
if (position2->word == NULL) //first on list
{
temp->word = word;
temp->freq = 1;
temp->next = NULL;
position2 = temp;
}
else if (position2->next != NULL) //middle of list
{
temp->word = word;
temp->freq = 1;
temp->next = position2->next;
position2->next = temp;
}
else if (position2->next == NULL) //last on list
{
temp->word = word;
temp->freq = 1;
temp->next = NULL;
position2->next = temp;
}
}
int lookup(alphalist *index, char *word, wordlist **position)
{
int wordfreq = 0;
int length = strlen(word);
char word2[length];
strcpy(word2, word);
printf("\nlookup:word = %s", word); //debug
printf("\nlookup:index->let = %c", index->let); //debug
printf("\nlookup:word2 = %s", word2); //debug
printf("\nlookup:word2[0] = %c", word2[0]); //debug
while (index != NULL)
{
printf("\nlookup-while:index->let = %c", index->let); //debug
if (word2[0] == index->let)
{
if (index->words == NULL)
{
printf("\nindex->word == NULL\n"); //debug
printf("Position for word %s: %d\n", word, &(index->words)); //debug
position = &(index->words);
printf("test: %d\n", position); //debug
wordfreq = 0;
break;
}
}
index = index->link;
}
return wordfreq;
}