Skip to content

Commit

Permalink
Fix inet Android build (#18056)
Browse files Browse the repository at this point in the history
* 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 <commits@restyled.io>
  • Loading branch information
dnicoara and restyled-commits authored May 5, 2022
1 parent 736aa0c commit b963a3f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/inet/InetInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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));

Expand Down Expand Up @@ -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));

Expand Down Expand Up @@ -615,7 +615,7 @@ static struct if_nameindex * backport_if_nameindex(void)
exit:
if (tmpval != NULL)
{
MemoryFree(tmpval);
Platform::MemoryFree(tmpval);
}

if (addrList != NULL)
Expand Down

0 comments on commit b963a3f

Please sign in to comment.