Skip to content

Commit

Permalink
Merge pull request #15 from mattiaswal/use-after-free
Browse files Browse the repository at this point in the history
BUG: Do not access cfg when cfg is free
  • Loading branch information
jonasj76 authored Jun 11, 2018
2 parents 890bdec + eefa59b commit 5598aeb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/dhcp-helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,8 @@ static void cleanup(struct ev_loop *loop)
}
}
/* UDP socket not necessary to 'restart' */
conf_free(cfg);
cleanup_nftables(cfg);
conf_free(cfg);
}

static struct ev_loop *init(struct ev_loop *loop, char *fname)
Expand Down
1 change: 1 addition & 0 deletions src/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ int cleanup_nftables(cfg_t *cfg)
}

if (anybridged) {
syslog2(LOG_DEBUG, "Some interfaces is bridged, remove nftables rules");
if (system("nft delete chain bridge filter " NFT_IN_CHAIN))
syslog2(LOG_ERR, "Failed deleting nftables input rules");
if (system("nft delete chain bridge filter " NFT_FWD_CHAIN))
Expand Down

0 comments on commit 5598aeb

Please sign in to comment.