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:
@ -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;
|
||||
|
Reference in New Issue
Block a user