fixed memory leaks, added cleanup code, added valgrind scripts to test binaries

This commit is contained in:
Martin Preuss
2023-08-09 17:24:44 +02:00
parent 4701a71986
commit b5916acf79
41 changed files with 991 additions and 170 deletions

View File

@@ -36,16 +36,16 @@ AQHOME_STORAGE *AqHomeStorage_new()
void AqHomeStorage_free(AQHOME_STORAGE *aqh)
{
if (aqh) {
AQH_Service_free(aqh->httpService);
aqh->httpService=NULL;
AQH_Storage_free(aqh->storage);
GWEN_MsgEndpoint_free(aqh->rootEndpoint);
GWEN_MsgEndpoint_free(aqh->rootEndpoint);
GWEN_DB_Group_free(aqh->dbArgs);
aqh->storage=NULL;
GWEN_MsgEndpoint_free(aqh->rootEndpoint);
aqh->rootEndpoint=NULL;
aqh->ipcdEndpoint=NULL;
aqh->mqttEndpoint=NULL;
aqh->httpdEndpoint=NULL;
GWEN_DB_Group_free(aqh->dbArgs);
aqh->dbArgs=NULL;
free(aqh->pidFile);
@@ -114,6 +114,13 @@ void AqHomeStorage_SetPidFile(AQHOME_STORAGE *aqh, const char *s)
int AqHomeStorage_GetTimeout(const AQHOME_STORAGE *aqh)
{
return aqh?aqh->timeout:0;
}