Commit 72da63f3 authored by Nick Mathewson's avatar Nick Mathewson 🐹
Browse files

It is not an error to set an array with allocated size 0 to have length 0.

parent 0c763b09
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1488,7 +1488,7 @@ class AccessorFnGenerator(CodeGenerator):
                               &inp->{c_name}.n_, inp->{c_name}.elts_, newlen,
                               sizeof(inp->{c_name}.elts_[0]), {freefn},
                               &inp->trunnel_error_code_);
                if (newptr == NULL)
                if (newlen != 0 && newptr == NULL)
                  goto trunnel_alloc_failed;
                inp->{c_name}.elts_ = newptr;
                return 0;""", c_name=sva.c_name, freefn=freefn)