I keep passing in and returning the dirs_later_array. When I get to \"new_size=...\" in the else block, I end up with new_size of 2 the second time around. So far so good.
Operator sizeof is a compile time feature and it only checks the static size of an expression. So for pointer it only returns the size of that pointer which is 4 on your platform. sizeof does not measure the size of a dynamically allocated data. There is no standard feature in C to get the size of dynamically allocated data.