g_autoptr(GHashTable) chains = virHashNew(NULL);
g_autoptr(GHashTable) links = virHashNew(NULL);
const char *const *tmp;
- int ret = -1;
size_t i;
tmp = lines;
while (tmp && *tmp) {
if (STRPREFIX(*tmp, "-N ")) { /* eg "-N LIBVIRT_INP" */
if (virHashUpdateEntry(chains, *tmp + 3, (void *)0x1) < 0)
- goto cleanup;
+ return -1;
} else if (STRPREFIX(*tmp, "-A ")) { /* eg "-A INPUT -j LIBVIRT_INP" */
char *sep = strchr(*tmp + 3, ' ');
if (sep) {
if (STRPREFIX(sep + 1, "-j ")) {
if (virHashUpdateEntry(links, sep + 4,
(char *)*tmp + 3) < 0)
- goto cleanup;
+ return -1;
}
}
}
"--jump", data->chains[i].child, NULL);
}
- ret = 0;
- cleanup:
- return ret;
+ return 0;
}