Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: fix linked list leaks #782

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions test/linux/eepromtool/eepromtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,7 @@ int main(int argc, char *argv[])
else
{
ec_adaptert * adapter = NULL;
ec_adaptert * node = NULL;

printf("Usage: eepromtool ifname slave OPTION fname|alias\n");
printf("ifname = eth0 for example\n");
Expand All @@ -470,10 +471,11 @@ int main(int argc, char *argv[])

printf ("\nAvailable adapters:\n");
adapter = ec_find_adapters ();
while (adapter != NULL)
node = adapter;
while (node != NULL)
{
printf (" - %s (%s)\n", adapter->name, adapter->desc);
adapter = adapter->next;
printf (" - %s (%s)\n", node->name, node->desc);
node = node->next;
}
ec_free_adapters(adapter);
}
Expand Down
8 changes: 5 additions & 3 deletions test/linux/simple_test/simple_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,14 +242,16 @@ int main(int argc, char *argv[])
else
{
ec_adaptert * adapter = NULL;
ec_adaptert * node = NULL;
printf("Usage: simple_test ifname1\nifname = eth0 for example\n");

printf ("\nAvailable adapters:\n");
adapter = ec_find_adapters ();
while (adapter != NULL)
node = adapter;
while (node != NULL)
{
printf (" - %s (%s)\n", adapter->name, adapter->desc);
adapter = adapter->next;
printf (" - %s (%s)\n", node->name, node->desc);
node = node->next;
}
ec_free_adapters(adapter);
}
Expand Down
8 changes: 5 additions & 3 deletions test/linux/slaveinfo/slaveinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -711,14 +711,16 @@ int main(int argc, char *argv[])
}
else
{
ec_adaptert * node;
printf("Usage: slaveinfo ifname [options]\nifname = eth0 for example\nOptions :\n -sdo : print SDO info\n -map : print mapping\n");

printf ("Available adapters\n");
adapter = ec_find_adapters ();
while (adapter != NULL)
node = adapter;
while (node != NULL)
{
printf ("Description : %s, Device to use for wpcap: %s\n", adapter->desc,adapter->name);
adapter = adapter->next;
printf ("Description : %s, Device to use for wpcap: %s\n", node->desc,node->name);
node = node->next;
}
ec_free_adapters(adapter);
}
Expand Down
8 changes: 5 additions & 3 deletions test/simple_ng/simple_ng.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,15 +287,17 @@ main(int argc, char *argv[])

if (argc != 2) {
ec_adaptert * adapter = NULL;
ec_adaptert * node = NULL;
printf("Usage: simple_ng IFNAME1\n"
"IFNAME1 is the NIC interface name, e.g. 'eth0'\n");

printf("\nAvailable adapters:\n");
adapter = ec_find_adapters();
while (adapter != NULL)
node = adapter;
while (node != NULL)
{
printf(" - %s (%s)\n", adapter->name, adapter->desc);
adapter = adapter->next;
printf(" - %s (%s)\n", node->name, node->desc);
node = node->next;
}
ec_free_adapters(adapter);
return 1;
Expand Down