virsh: console: Avoid using stream after being freed.

The stream object wasn't set to NULL after freeing causing a double free
attempt on the cleanup path.
(cherry picked from commit e3b8808ba7)
This commit is contained in:
Peter Krempa 2012-08-03 13:16:24 +02:00 committed by Cole Robinson
parent 20d781692a
commit c02482bdd8

View File

@ -101,6 +101,7 @@ virConsoleShutdown(virConsolePtr con)
virStreamEventRemoveCallback(con->st);
virStreamAbort(con->st);
virStreamFree(con->st);
con->st = NULL;
}
VIR_FREE(con->streamToTerminal.data);
VIR_FREE(con->terminalToStream.data);