Simple question, but the other similar questions on here are don't deal with this specific case, or so i could find.
int * moves;
moves = malloc(540); //540 is the most i will ever need, usually less
someFunctionThatFillsSomeOfThoseSlots // also returns how many slots were used
int * final = malloc(size+1);
for(x = 0; x < size; x++, final++, moves++)
final = moves;
final -= size;
how should i be freeing the memory of moves, after having changed its pointer?