[Spice-commits] server/reds.c
Frediano Ziglio
fziglio at kemper.freedesktop.org
Wed Aug 26 07:43:26 PDT 2015
server/reds.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
New commits:
commit 9a62481b83bcb02c79f66d84e6176def09d63cda
Author: Frediano Ziglio <fziglio at redhat.com>
Date: Wed Aug 26 15:29:05 2015 +0100
Avoid core calling spice_server_destroy
spice_server_destroy calls reds_exit which is called also at exit time
(is registered with atexit) so avoid to keep dangling pointers.
Currently this does not happen as spice_server_destroy is not called
by Qemu.
Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
diff --git a/server/reds.c b/server/reds.c
index c07cb6c..5d2ad9b 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -2700,8 +2700,11 @@ static void reds_exit(void)
main_channel_close(reds->main_channel);
}
#ifdef RED_STATISTICS
- shm_unlink(reds->stat_shm_name);
- free(reds->stat_shm_name);
+ if (reds->stat_shm_name) {
+ shm_unlink(reds->stat_shm_name);
+ free(reds->stat_shm_name);
+ reds->stat_shm_name = NULL;
+ }
#endif
}
More information about the Spice-commits
mailing list