Introducing fixes to memory leak issues identified by static code analysis
tool.
Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Signed-off-by: Maciej Rabeda <maciej.rabeda@linux.intel.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Reviewed-by: Siyuan Fu <siyuan.fu@intel.com>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
//\r
// Unexpected message type.\r
//\r
+ FreePool(TxCb);\r
return EFI_DEVICE_ERROR;\r
}\r
\r
IP4_INTERFACE *Interface;\r
EFI_SIMPLE_NETWORK_MODE SnpMode;\r
\r
+ if (Mnp == NULL) {\r
+ return NULL;\r
+ }\r
+\r
Interface = AllocatePool (sizeof (IP4_INTERFACE));\r
\r
- if ((Interface == NULL) || (Mnp == NULL)) {\r
+ if (Interface == NULL) {\r
return NULL;\r
}\r
\r
);\r
if (EFI_ERROR (Status)) {\r
IpIoRemoveIp (IpIo, Tcb->IpInfo);\r
+ FreePool (Tcb);\r
return Status;\r
}\r
\r