int *sub()
{
 return (int *)malloc(sizeof(int) * 10);
}
x = sub();

もしくは

void sub(int **x)
{
 *x = (int *)malloc(sizeof(int) * 10);
}
sub(&x);