Assuming this is In C++ (or C?). Arrays are passed by reference. The array name is a pointer to the first memory location. In your case, you need to pass data instead of data[size] as the latter ends up passing the value at data[size] (which should go out of bounds since your array length is size but arrays are accessed by index (so technically you would go up to size-1).
Here's what you need to do to fix it:
sData=sumData(data,size); // when you pass data, you're passing the address of the first memory location that data points to.