Commit 36d7e152 authored by Ulrich Sibiller's avatar Ulrich Sibiller

Atoms.c: silence PVS Studio warning

"V701 realloc() possible leak: when realloc() fails in allocating memory, original pointer 'privAtomMap' is lost. Consider assigning realloc() to a temporary pointer."
parent e991dbae
......@@ -385,12 +385,16 @@ static void nxagentExpandCache(void)
{
privAtomMapSize += NXAGENT_ATOM_MAP_SIZE_INCREMENT;
privAtomMap = realloc(privAtomMap, privAtomMapSize * sizeof(AtomMap));
AtomMap * newmap = realloc(privAtomMap, privAtomMapSize * sizeof(AtomMap));
if (privAtomMap == NULL)
if (newmap == NULL)
{
FatalError("nxagentExpandCache: realloc failed\n");
}
else
{
privAtomMap = newmap;
}
}
/*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment