diff options
Diffstat (limited to 'src/nat.c')
-rwxr-xr-x | src/nat.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -55,8 +55,10 @@ static int enable_ip_forward(bool enable) if (read(f, &value, sizeof(value)) < 0) value = 0; - if (lseek(f, 0, SEEK_SET) < 0) + if (lseek(f, 0, SEEK_SET) < 0) { + close(f); return -errno; + } } if (enable) { @@ -201,7 +203,7 @@ static void cleanup_nat(gpointer data) g_free(nat); } -static struct connman_notifier nat_notifier = { +static const struct connman_notifier nat_notifier = { .name = "nat", .default_changed = update_default_interface, }; |