mirror of https://gitee.com/openkylin/libvirt.git
console: plug memory leaks
Using 'virReallocN' to allocate memory on virConsoleEventOnStdin, virConsoleEventOnStdout and virConsoleEventOnStream, however, the cleanup function virConsoleShutdown hasn't released these memory. * tools/console.c: fix memory leaks on virConsoleShutdown. https://bugzilla.redhat.com/show_bug.cgi?id=767488 Signed-off-by: Alex Jia <ajia@redhat.com>
This commit is contained in:
parent
5abbe04d68
commit
2b603dcb6c
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* console.c: A dumb serial console client
|
* console.c: A dumb serial console client
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007, 2008, 2010 Red Hat, Inc.
|
* Copyright (C) 2007-2008, 2010-2011 Red Hat, Inc.
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -101,6 +101,8 @@ virConsoleShutdown(virConsolePtr con)
|
||||||
virStreamAbort(con->st);
|
virStreamAbort(con->st);
|
||||||
virStreamFree(con->st);
|
virStreamFree(con->st);
|
||||||
}
|
}
|
||||||
|
VIR_FREE(con->streamToTerminal.data);
|
||||||
|
VIR_FREE(con->terminalToStream.data);
|
||||||
if (con->stdinWatch != -1)
|
if (con->stdinWatch != -1)
|
||||||
virEventRemoveHandle(con->stdinWatch);
|
virEventRemoveHandle(con->stdinWatch);
|
||||||
if (con->stdoutWatch != -1)
|
if (con->stdoutWatch != -1)
|
||||||
|
|
Loading…
Reference in New Issue