]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Filter: Don't alloc varargs array if its length would be zero
authorMaria Matejka <mq@ucw.cz>
Wed, 14 Aug 2019 09:49:20 +0000 (11:49 +0200)
committerMaria Matejka <mq@ucw.cz>
Fri, 1 May 2020 13:19:12 +0000 (15:19 +0200)
filter/decl.m4

index efecb9a57e6f9e4468c92826a2c98ab785fb70ca..14b9329c95b478d7b88f36afbecbbd29ffd0b750 100644 (file)
@@ -138,7 +138,7 @@ FID_IFCONST([[
 }
 FID_IFCONST([[
   const struct f_inst **items = NULL;
-  if (constargs) {
+  if (constargs && whati->varcount) {
     items = alloca(whati->varcount * sizeof(struct f_inst *));
     const struct f_inst *child = fvar;
     for (uint i=0; child; i++)