mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-07 09:00:28 +00:00
Do not do the useless job for an empty table.
MFC after: 1 month
This commit is contained in:
parent
3aeb70f799
commit
03d4b38d9e
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=183205
|
@ -5937,6 +5937,11 @@ table_handler(int ac, char *av[])
|
|||
l = sizeof(a);
|
||||
if (do_cmd(IP_FW_TABLE_GETSIZE, &a, (uintptr_t)&l) < 0)
|
||||
err(EX_OSERR, "getsockopt(IP_FW_TABLE_GETSIZE)");
|
||||
|
||||
/* If a is zero we have nothing to do, the table is empty. */
|
||||
if (a == 0)
|
||||
return;
|
||||
|
||||
l = sizeof(*tbl) + a * sizeof(ipfw_table_entry);
|
||||
tbl = malloc(l);
|
||||
if (tbl == NULL)
|
||||
|
|
Loading…
Reference in a new issue