diff options
author | Maciej Rabeda <maciej.rabeda@linux.intel.com> | 2019-11-28 15:46:06 +0100 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2019-12-04 01:16:45 +0000 |
commit | 4f47eaf9456e1a4f22553fe0c97587c2124e2fba (patch) | |
tree | 8af0bef19e68dfa411dbc9aad7920941b6afe350 /NetworkPkg/Ip4Dxe | |
parent | 4d613feee57ebd4680f3c23398a9b33723f29fd6 (diff) | |
download | edk2-4f47eaf9456e1a4f22553fe0c97587c2124e2fba.zip edk2-4f47eaf9456e1a4f22553fe0c97587c2124e2fba.tar.gz edk2-4f47eaf9456e1a4f22553fe0c97587c2124e2fba.tar.bz2 |
NetworkPkg: Fixes to static code analysis hits
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>
Diffstat (limited to 'NetworkPkg/Ip4Dxe')
-rw-r--r-- | NetworkPkg/Ip4Dxe/Ip4If.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/NetworkPkg/Ip4Dxe/Ip4If.c b/NetworkPkg/Ip4Dxe/Ip4If.c index 53a3330..348f2e0 100644 --- a/NetworkPkg/Ip4Dxe/Ip4If.c +++ b/NetworkPkg/Ip4Dxe/Ip4If.c @@ -491,9 +491,13 @@ Ip4CreateInterface ( IP4_INTERFACE *Interface;
EFI_SIMPLE_NETWORK_MODE SnpMode;
+ if (Mnp == NULL) {
+ return NULL;
+ }
+
Interface = AllocatePool (sizeof (IP4_INTERFACE));
- if ((Interface == NULL) || (Mnp == NULL)) {
+ if (Interface == NULL) {
return NULL;
}
|