[PATCH] main_channel: fix double release of migration target data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If client_migrate_info was called once with cert-host-subject and
then again without cert-host-subject, on a third call to
client_migrate info, the cert-host-subject from the first call would
have been freed for the second time.
---
 server/main_channel.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/server/main_channel.c b/server/main_channel.c
index 4cf7e19..233e633 100644
--- a/server/main_channel.c
+++ b/server/main_channel.c
@@ -671,6 +671,8 @@ static void main_channel_fill_mig_target(MainChannel *main_channel, RedsMigSpice
     free(main_channel->mig_target.cert_subject);
     if (mig_target->cert_subject) {
         main_channel->mig_target.cert_subject = spice_strdup(mig_target->cert_subject);
+    } else {
+        main_channel->mig_target.cert_subject = NULL;
     }
     main_channel->mig_target.port = mig_target->port;
     main_channel->mig_target.sport = mig_target->sport;
-- 
1.8.1.4

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]