]> 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>
Tue, 28 Apr 2020 14:25:14 +0000 (16:25 +0200)
filter/decl.m4

index 71ac8803a5107d0255bbe8dce5f23dae1fe6c05b..a5cead756472129369f12e3137aa3316e5395d96 100644 (file)
@@ -143,7 +143,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++)