mirror of
git://git.code.sf.net/p/dhcpd-pools/code
synced 2025-12-17 00:06:59 +00:00
flose files & free memory when not needed
Fixes to issues found with valgrind. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
parent
b11163012e
commit
a10396710e
2 changed files with 4 additions and 0 deletions
|
|
@ -163,6 +163,7 @@ int parse_leases(void)
|
||||||
if (macaddr != NULL) {
|
if (macaddr != NULL) {
|
||||||
free(macstring);
|
free(macstring);
|
||||||
}
|
}
|
||||||
|
fclose(dhcpd_leases);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -452,5 +453,6 @@ char *parse_config(int is_include, char *config_file,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
free(word);
|
free(word);
|
||||||
|
fclose(dhcpd_config);
|
||||||
return next_free_shared_name;
|
return next_free_shared_name;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -94,6 +94,8 @@ void clean_up(void)
|
||||||
free(config.dhcpdlease_file);
|
free(config.dhcpdlease_file);
|
||||||
free(config.output_file);
|
free(config.output_file);
|
||||||
free(ranges);
|
free(ranges);
|
||||||
|
free(leases);
|
||||||
|
free(touches);
|
||||||
free(shared_net_names);
|
free(shared_net_names);
|
||||||
free(shared_networks);
|
free(shared_networks);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue