mirror of
git://git.code.sf.net/p/dhcpd-pools/code
synced 2025-12-18 08:47:00 +00:00
shared network names to be dynamically allocated
This patch is a step a head to make data all structures completely dynamic. After this the next obvious thing to do is to make shared networks struct a linked list instead of a list. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
parent
b492802dfa
commit
c81af2df45
5 changed files with 18 additions and 55 deletions
15
src/other.c
15
src/other.c
|
|
@ -85,25 +85,22 @@ void flip_ranges(struct range_t *ranges, struct range_t *tmp_ranges)
|
|||
/* Free memory, flush buffers etc */
|
||||
void clean_up(void)
|
||||
{
|
||||
int ret;
|
||||
unsigned int i;
|
||||
|
||||
/* Just in case there something in buffers */
|
||||
ret = fflush(stdout);
|
||||
if (errno || ret) {
|
||||
warn("clean_up: stdout");
|
||||
if (fflush(NULL)) {
|
||||
warn("clean_up: fflush");
|
||||
}
|
||||
ret = fflush(stderr);
|
||||
if (errno || ret) {
|
||||
warn("clean_up: stderr");
|
||||
num_shared_networks++;
|
||||
for (i = 0; i < num_shared_networks; i++) {
|
||||
free((shared_networks + i)->name);
|
||||
}
|
||||
|
||||
free(config.dhcpdconf_file);
|
||||
free(config.dhcpdlease_file);
|
||||
free(config.output_file);
|
||||
free(ranges);
|
||||
free(leases);
|
||||
free(touches);
|
||||
free(shared_net_names);
|
||||
free(shared_networks);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue