It is. You balance out malloc() calls with free() calls.
You are also not explicitly allocating an array, at least not as far as the OS, CPU, TLB or RAM is concerned. All you do is request a contiguous block of memory.
Shitlord by trade and passion. Graphics programmer at Laminar Research. I write blog posts at feresignum.com