Also, this is one of the reasons why pointers need to die forever and just making structs pass by reference would be much nicer from a design standpoint:
Code:
point3d *what(point2d *source) { //this is the same function as above, only much more awesome
double *i = (double *)realloc(source,3*sizeof(double));
*(i+2) = something;
return (point3d *)i;
}