-No need to check if a pointer is null before freeing it.
-However if the pointer is still living (for example a global) you should assign NULL to it to avoid bad ram access and random bugs. Accessing a NULL pointer always gives a segfault, accessing a freed pointer may or may not crash. -Also fixed a memory leak git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@924 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
@@ -5483,8 +5483,8 @@ void Load_PC1(void)
|
||||
else
|
||||
{
|
||||
File_error=1;
|
||||
if (bufferdecomp) free(bufferdecomp);
|
||||
if (buffercomp) free(buffercomp);
|
||||
free(bufferdecomp);
|
||||
free(buffercomp);
|
||||
}
|
||||
fclose(file);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user