mirror of https://github.com/krustur/IconSnap.git
AllocVec/FreeVec instead of malloc/free
This commit is contained in:
parent
5e5ccb35a4
commit
4d35d99004
16
src/main.c
16
src/main.c
|
@ -210,10 +210,10 @@ int main(int argc, char **argv)
|
|||
}
|
||||
|
||||
// Allocate memory areas
|
||||
AlignCurrentWorkingDirTempPath = malloc(PATH_MAX);
|
||||
AlignDirFixedDirName = malloc(PATH_MAX);
|
||||
AlignDirFullPath = malloc(PATH_MAX);
|
||||
AlignIconFixedDiskObjectName = malloc(PATH_MAX);
|
||||
AlignCurrentWorkingDirTempPath = AllocVec(PATH_MAX, MEMF_ANY);
|
||||
AlignDirFixedDirName = AllocVec(PATH_MAX, MEMF_ANY);
|
||||
AlignDirFullPath = AllocVec(PATH_MAX, MEMF_ANY);
|
||||
AlignIconFixedDiskObjectName = AllocVec(PATH_MAX, MEMF_ANY);
|
||||
|
||||
unsigned int fixCount = 0;
|
||||
if (!fileOption && !dirOption)
|
||||
|
@ -259,19 +259,19 @@ void CleanExit()
|
|||
{
|
||||
if (AlignCurrentWorkingDirTempPath != NULL)
|
||||
{
|
||||
free(AlignCurrentWorkingDirTempPath);
|
||||
FreeVec(AlignCurrentWorkingDirTempPath);
|
||||
}
|
||||
if (AlignDirFixedDirName != NULL)
|
||||
{
|
||||
free(AlignDirFixedDirName);
|
||||
FreeVec(AlignDirFixedDirName);
|
||||
}
|
||||
if (AlignDirFullPath != NULL)
|
||||
{
|
||||
free(AlignDirFullPath);
|
||||
FreeVec(AlignDirFullPath);
|
||||
}
|
||||
if (AlignIconFixedDiskObjectName != NULL)
|
||||
{
|
||||
free(AlignIconFixedDiskObjectName);
|
||||
FreeVec(AlignIconFixedDiskObjectName);
|
||||
}
|
||||
if (rdargs != NULL)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue