BaseTools/C/Common: Fix potential memory leak

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
Hao Wu
2016-09-28 11:18:12 +08:00
parent 5e85fb52d0
commit aee346514d
4 changed files with 36 additions and 12 deletions

View File

@ -125,10 +125,12 @@ Returns:
Status = StripInfDscStringInPlace (NextLine);
if (EFI_ERROR (Status)) {
free (NextLine);
break;
}
if (NextLine[0] == '\0') {
free (NextLine);
continue;
}
@ -153,8 +155,12 @@ Returns:
LastGuidTool = NewGuidTool;
}
}
}
if (Tool != NULL) {
FreeStringList (Tool);
}
free (NextLine);
}
return FirstGuidTool;