strdup() mem leak fix (#33)

* Mem leak fix

Memleak fix for strdup()

* Typo fix

forgot ;
This commit is contained in:
Phil
2023-01-18 19:44:29 +02:00
committed by GitHub
parent 30469e8e9d
commit 48b52ae645

View File

@@ -512,6 +512,10 @@ int main(int argc, char *argv[])
// Check for auto-update.
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.
updateconfig(&cfg, cmd.cfgfile);