You have newDynArray which points to the dynamic array for which also you need to allocate memory -
Try something like this (Not tested)
dynArray *createDynArray(int n) {
dynArray *newDynArray = malloc(sizeof(dynArray));
newDynArray->size = n;
newDynArray->darray = calloc(n, sizeof(double));
return newDynArray;
}
Remember to free both in your free operation to avoid the memory leak.