summaryrefslogtreecommitdiff
path: root/src/listen.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@sun.com>2007-04-05 14:07:42 -0700
committerAlan Coopersmith <alan.coopersmith@sun.com>2007-04-05 14:07:42 -0700
commitc9b3d016681d81aff32c74cdad75151bd538e6ab (patch)
tree586efe6246433801110510669e2ee0e01c2b415d /src/listen.c
parent6039e865470af23948b0fe7d5dc0ea72da436b0e (diff)
downloadxorg-lib-libICE-c9b3d016681d81aff32c74cdad75151bd538e6ab.tar.gz
Coverity #1085: Double free of pointer "*listenObjsRet"
If malloc failed in the loop in IceListenForConnections, the error path would free all previous allocations, then loop around and try again, and if it failed again, free the previous allocations again. On the other hand, if it succeeded on the later tries, then the memory would just be leaked, since the error would be returned and not the pointer to them.
Diffstat (limited to 'src/listen.c')
-rw-r--r--src/listen.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/listen.c b/src/listen.c
index 7708cfe..9875f30 100644
--- a/src/listen.c
+++ b/src/listen.c
@@ -123,8 +123,10 @@ char *errorStringRet;
free ((char *) (*listenObjsRet)[j]);
free ((char *) *listenObjsRet);
+ *listenObjsRet = NULL;
status = 0;
+ break;
}
else
{