potential memory leak

This commit is contained in:
Douglas Clowes
2012-11-29 10:33:19 +11:00
parent 06eba7ce4b
commit e0c861c0ac

1
lld.c
View File

@ -89,6 +89,7 @@ static int ListInit(int List, int ItemSize)
*/
Tmp = NODE_MALLOC(List);
if (NULL == Tmp) {
Tmp = ListControl[List].first;
NODE_FREE(Tmp); /* no need to cause memory leaks */
ListControl[List].first = NULL; /* or other errors */
return ERR_MEMORY; /* even if we're in trouble ... */