My code is below:
int* smallerNumbersThanCurrent(int* nums, int numsSize, int* returnSize){
int count;
int* out = malloc(500);
int i, j;
for(i = 0; i < numsSize; ++i){
count = 0;
for(j = 0; j < numsSize; ++j){
if(nums[i] > nums[j]){
count++;
}
}
*(out + i) = count;
}
return out;
}
and the error messages are below

Actually, this heap-buffer-overflow kept coming up when I've solved the problems on Leetcode. even if it works well in Terminal on Mac.
will appreciate any comments or helps on it!