Note, what you are doing is a bit different than the Zero-Length Array technique. By having the full array in your structure, you allow yourself to create a variable of that type on the stack or statically, abet it will alway take the maximum size. If you declare the structure with a zero length array at the end, variables of that type can only really be created on the heap, and the call to malloc needs to add the amount of space needed for the flexible array allocation.
Note, that by allocating more array space than you need, you do NOT create the undefined behavior that the non-standard variants of the flexible array create, so it is ‘safe’ (as long as you don’t try to access elements in the array that were not set).