onak + wotsap were failing to free the memory allocated for the config
file name if it was passed on the command line, and the config structure
cleanups failed to free any configured sock_dir or the actual DB
backend config structure. All of this gets cleaned up by normal program
exit (which is when we do our clean-up anyway), but fix it anyway.
.logfile = NULL,
.use_keyd = false,
- .sock_dir = ".",
+ .sock_dir = NULL,
.backends = NULL,
.backends_dir = NULL,
free(dbconfig->password);
dbconfig->password = NULL;
}
+
+ free(dbconfig);
}
void cleanupconfig(void) {
free(config.backends_dir);
config.backends_dir = NULL;
}
+ if (config.sock_dir != NULL) {
+ free(config.sock_dir);
+ config.sock_dir = NULL;
+ }
if (config.bin_dir != NULL) {
free(config.bin_dir);
config.bin_dir = NULL;
cleanuplogthing();
cleanupconfig();
+ free(configfile);
return rc;
}
}
cleanuplogthing();
cleanupconfig();
+ free(configfile);
}