Just returning NULL instead of go to "err:" when
"table" is NULL, also removing a duplicated
g_free(module).
It's avoiding, at least, a "goto" + "g_free()" +
"table_cleanup()".
DBG("%s", table_name);
if (xtables_insmod("ip_tables", NULL, TRUE) != 0)
- goto err;
+ return NULL;
module = g_strconcat("iptable_", table_name, NULL);
if (module == NULL)
- goto err;
+ return NULL;
- if (xtables_insmod(module, NULL, TRUE) != 0)
- goto err;
+ if (xtables_insmod(module, NULL, TRUE) != 0) {
+ g_free(module);
+ return NULL;
+ }
g_free(module);
- module = NULL;
table = g_hash_table_lookup(table_hash, table_name);
if (table != NULL)
return table;
err:
- g_free(module);
-
table_cleanup(table);
return NULL;