summaryrefslogtreecommitdiff
path: root/os
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2015-03-09 09:55:57 -0700
committerPeter Hutterer <peter.hutterer@who-t.net>2015-03-13 12:31:21 +1000
commit7ea64fb4374504bd3d524fc08c90efdab9f253ea (patch)
treee5b475cc5352a4375abacca96e8b5fab63e4020a /os
parent6d3cf35a6f0856ac44a7be560e2265461f9bb32b (diff)
Clear ListenTransConns entries in CloseWellKnownConnections
Since _XSERVTransClose frees the connection pointer passed to it, remove that pointer from the array, so we don't try to double free it if we come back into CloseWellKnownConnections again. Should fix https://bugzilla.yoctoproject.org/show_bug.cgi?id=6665 in which the shutdown section of the main() loop called CloseWellKnownConnections() and then moved on to ddxGiveUp(), which failed to release the VT and thus called AbortServer(), which called CloseWellKnownConnections() again. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'os')
-rw-r--r--os/connection.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/os/connection.c b/os/connection.c
index ddfe50a3e..7ff44e175 100644
--- a/os/connection.c
+++ b/os/connection.c
@@ -513,8 +513,13 @@ CloseWellKnownConnections(void)
{
int i;
- for (i = 0; i < ListenTransCount; i++)
- _XSERVTransClose(ListenTransConns[i]);
+ for (i = 0; i < ListenTransCount; i++) {
+ if (ListenTransConns[i] != NULL) {
+ _XSERVTransClose(ListenTransConns[i]);
+ ListenTransConns[i] = NULL;
+ }
+ }
+ ListenTransCount = 0;
}
static void