Neither is correct, because in both cases t is on the stack and invalid after the function returns.

This is correct, but you must remember to free the memory some time later otherwise this will leak memory:
Code:
char *morefun()
{
  char *t=malloc(6*sizeof(char));
  strcpy(t,"pawan");
  return t;
}