strdup() mem leak fix (#33)
* Mem leak fix Memleak fix for strdup() * Typo fix forgot ;
This commit is contained in:
@@ -512,6 +512,10 @@ int main(int argc, char *argv[])
|
|||||||
// Check for auto-update.
|
// Check for auto-update.
|
||||||
if (cfg.updatetime > 0 && (curTime - lastupdated) > cfg.updatetime)
|
if (cfg.updatetime > 0 && (curTime - lastupdated) > cfg.updatetime)
|
||||||
{
|
{
|
||||||
|
// Memleak fix for strdup() in updateconfig()
|
||||||
|
// Before updating it again, we need to free the old return value
|
||||||
|
free(cfg.interface);
|
||||||
|
|
||||||
// Update config.
|
// Update config.
|
||||||
updateconfig(&cfg, cmd.cfgfile);
|
updateconfig(&cfg, cmd.cfgfile);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user