From b963a3fcd593631b945edddb7f8e9e4679f1555d Mon Sep 17 00:00:00 2001 From: Daniel Nicoara Date: Wed, 4 May 2022 23:29:00 -0400 Subject: [PATCH] Fix inet Android build (#18056) * Fix inet Android build MemoryFree and MemoryAlloc are in the ::chip::Platform namespace, while the call sites are in the ::chip::Inet namespace. * Restyled by clang-format Co-authored-by: Restyled.io --- src/inet/InetInterface.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/inet/InetInterface.cpp b/src/inet/InetInterface.cpp index 72da25ea7ad7a2..688935b02cf5c1 100644 --- a/src/inet/InetInterface.cpp +++ b/src/inet/InetInterface.cpp @@ -507,11 +507,11 @@ static void backport_if_freenameindex(struct if_nameindex * inArray) { if (inArray[i].if_name != NULL) { - MemoryFree(inArray[i].if_name); + Platform::MemoryFree(inArray[i].if_name); } } - MemoryFree(inArray); + Platform::MemoryFree(inArray); } static struct if_nameindex * backport_if_nameindex(void) @@ -543,7 +543,7 @@ static struct if_nameindex * backport_if_nameindex(void) lastIntfName = addrIter->ifa_name; } - tmpval = (struct if_nameindex *) MemoryAlloc((numIntf + 1) * sizeof(struct if_nameindex)); + tmpval = (struct if_nameindex *) Platform::MemoryAlloc((numIntf + 1) * sizeof(struct if_nameindex)); VerifyOrExit(tmpval != NULL, ); memset(tmpval, 0, (numIntf + 1) * sizeof(struct if_nameindex)); @@ -575,7 +575,7 @@ static struct if_nameindex * backport_if_nameindex(void) } } - retval = (struct if_nameindex *) MemoryAlloc((maxIntfNum + 1) * sizeof(struct if_nameindex)); + retval = (struct if_nameindex *) Platform::MemoryAlloc((maxIntfNum + 1) * sizeof(struct if_nameindex)); VerifyOrExit(retval != NULL, ); memset(retval, 0, (maxIntfNum + 1) * sizeof(struct if_nameindex)); @@ -615,7 +615,7 @@ static struct if_nameindex * backport_if_nameindex(void) exit: if (tmpval != NULL) { - MemoryFree(tmpval); + Platform::MemoryFree(tmpval); } if (addrList != NULL)