g_alloca() in a more typesafe manner.
As mentioned in the documentation for g_alloca(),
n_structs must always be
entirely under the control of the program, or you may introduce a denial of
service vulnerability. In addition, the multiplication of
n_structs is not checked, so an overflow may lead to a remote code execution vulnerability.