A single function for implementing Newton forward and backward polynomial interpolation
Don't cast the result from malloc()
Instead, include &lt;stdlib.h&gt; so that the compiler knows it returns a void*.  Also, it's a good practice to use the object name as argument to sizeof, so its type can be changed in one place (e.g. if you wanted to use float or long double instead).  It's idiomatic to test a pointer isn't null by using the ! operator on it.
double *result = malloc(sizeof result * n);
if (!result)
    return -2;

Be careful about memory leaks
I don't see a corresponding free() of result or xList - we should be clear that this is the caller's responsibility.  It's also easily missed that the function won't free an existing poly-&gt;coeff or poly-&gt;xList before overwriting - I think that's a big magnet for inviting leaks.