From 5c4df2f6c3c32edd3d845951ce7c55c311d7f883 Mon Sep 17 00:00:00 2001 From: Frediano Ziglio Date: Mon, 11 Sep 2017 16:15:49 +0100 Subject: [PATCH] Use GLib memory functions for RedsMigSpice::host Signed-off-by: Frediano Ziglio Acked-by: Jonathon Jongsma --- server/main-channel.c | 4 ++-- server/reds.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/server/main-channel.c b/server/main-channel.c index 9d2590aa..d1fe8bd7 100644 --- a/server/main-channel.c +++ b/server/main-channel.c @@ -137,8 +137,8 @@ void main_channel_push_multi_media_time(MainChannel *main_chan, uint32_t time) static void main_channel_fill_mig_target(MainChannel *main_channel, RedsMigSpice *mig_target) { spice_assert(mig_target); - free(main_channel->mig_target.host); - main_channel->mig_target.host = spice_strdup(mig_target->host); + g_free(main_channel->mig_target.host); + main_channel->mig_target.host = g_strdup(mig_target->host); free(main_channel->mig_target.cert_subject); if (mig_target->cert_subject) { main_channel->mig_target.cert_subject = spice_strdup(mig_target->cert_subject); diff --git a/server/reds.c b/server/reds.c index dafaf481..d1b79b33 100644 --- a/server/reds.c +++ b/server/reds.c @@ -2964,7 +2964,7 @@ static void reds_mig_release(RedServerConfig *config) { if (config->mig_spice) { free(config->mig_spice->cert_subject); - free(config->mig_spice->host); + g_free(config->mig_spice->host); free(config->mig_spice); config->mig_spice = NULL; } @@ -4117,7 +4117,7 @@ static int reds_set_migration_dest_info(RedsState *reds, spice_migration = spice_new0(RedsMigSpice, 1); spice_migration->port = port; spice_migration->sport = secure_port; - spice_migration->host = spice_strdup(dest); + spice_migration->host = g_strdup(dest); if (cert_subject) { spice_migration->cert_subject = spice_strdup(cert_subject); }