Fix some memory leaks found by smatch.
diff --git a/programs/notepad/dialog.c b/programs/notepad/dialog.c
index a99465f..d6a6f4b 100644
--- a/programs/notepad/dialog.c
+++ b/programs/notepad/dialog.c
@@ -491,6 +491,7 @@
EndDoc(printer.hDC);
DeleteDC(printer.hDC);
+ HeapFree(GetProcessHeap(), 0, pTemp);
}
VOID DIALOG_FilePrinterSetup(VOID)
diff --git a/programs/regapi/regapi.c b/programs/regapi/regapi.c
index e08c727..f57a3b0 100644
--- a/programs/regapi/regapi.c
+++ b/programs/regapi/regapi.c
@@ -736,6 +736,7 @@
strncpy(lpsRes, lpsData, lLen);
lpsRes[lLen-1]='\0';
}
+ HeapFree(GetProcessHeap(), 0, lpsData);
}
else
{
diff --git a/programs/regtest/regtest.c b/programs/regtest/regtest.c
index 92e0392..d112208 100644
--- a/programs/regtest/regtest.c
+++ b/programs/regtest/regtest.c
@@ -228,6 +228,8 @@
lSts = RegEnumKey(HKEY_CURRENT_USER,0,sVal,lVal);
if (lSts != ERROR_MORE_DATA) xERROR(3,lSts);
+
+ free(sVal);
}
/******************************************************************************
@@ -255,6 +257,9 @@
lSts = RegEnumKeyEx(HKEY_LOCAL_MACHINE,0,sVal,&lLen1,0,sClass,&lLen2,&ft);
if (lSts != ERROR_MORE_DATA) xERROR(3,lSts);
+
+ free(sVal);
+ free(sClass);
}
/******************************************************************************
@@ -288,6 +293,9 @@
lSts = RegEnumValue(HKEY_LOCAL_MACHINE,1,sVal,&lVal,0,&lType,bVal,&lLen1);
if (lSts != ERROR_NO_MORE_ITEMS) xERROR(5,lSts);
+
+ free(sVal);
+ free(bVal);
}
/******************************************************************************
@@ -448,6 +456,8 @@
&lMaxSubLen,&lMaxClassLen,&lValues,&lMaxValNameLen,
&lMaxValLen,&lSecDescLen, &ft);
if (lSts != ERROR_SUCCESS) xERROR(2,lSts);
+
+ free(sClass);
}
/******************************************************************************
@@ -473,6 +483,8 @@
lSts = RegQueryValue(HKEY_CURRENT_USER,"",sVal,&lLen);
if (lSts != ERROR_SUCCESS) xERROR(4,lSts);
+
+ free(sVal);
}
/******************************************************************************
@@ -496,6 +508,8 @@
lSts = RegQueryValueEx(HKEY_LOCAL_MACHINE,"",0,&lType,sVal,&lLen);
if (lSts != ERROR_SUCCESS) xERROR(3,lSts);
+
+ free(sVal);
}
/******************************************************************************