Commit 9b56675d authored by Ulrich Sibiller's avatar Ulrich Sibiller Committed by Mike Gabriel

Rootless.c: fix common realloc mistake

As reported by static analyzer: (error) Common realloc mistake: 'ptr' nulled but not freed upon failure Attributes ArcticaProject/nx-libs#905
parent 434d5085
......@@ -151,10 +151,9 @@ void nxagentRootlessAddTopLevelWindow(WindowPtr pWin, Window w)
if (topLevelParentMap.next == topLevelParentMap.size)
{
TopLevelParentRec *ptr = topLevelParentMap.elt;
size_t size = (topLevelParentMap.size += TOP_LEVEL_TABLE_UNIT);
ptr = realloc(ptr, size * sizeof(TopLevelParentRec));
TopLevelParentRec *ptr = realloc(topLevelParentMap.elt, size * sizeof(TopLevelParentRec));
if (ptr == NULL)
{
......
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