Removed several memory leaks.
git-svn-id: svn://svn.cc65.org/cc65/trunk@5595 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -87,6 +87,18 @@ Attr* NewAttr (const char* Name, const char* Value)
|
||||
|
||||
|
||||
|
||||
void FreeAttr (Attr* A)
|
||||
/* Free an attribute structure */
|
||||
{
|
||||
/* Allow NULL pointers */
|
||||
if (A) {
|
||||
xfree (A->Name);
|
||||
xfree (A);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void DumpAttrColl (const Collection* C)
|
||||
/* Dump a collection of attribute/value pairs for debugging */
|
||||
{
|
||||
@@ -240,7 +252,7 @@ void SplitAddAttr (Collection* C, const char* Combined, const char* Name)
|
||||
|
||||
/* Release memory */
|
||||
SB_Done (&N);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -296,3 +308,19 @@ Collection* ParseAttrList (const char* List, const char** NameList, unsigned Nam
|
||||
|
||||
|
||||
|
||||
void FreeAttrList (Collection* C)
|
||||
/* Free a list of attributes */
|
||||
{
|
||||
unsigned I;
|
||||
|
||||
/* Walk over the collection and free all attributes */
|
||||
for (I = 0; I < CollCount (C); ++I) {
|
||||
FreeAttr (CollAtUnchecked (C, I));
|
||||
}
|
||||
|
||||
/* Free the collection itself */
|
||||
FreeCollection (C);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user