[Spice-devel] [PATCH spice-server 10/11] Use GLib memory functions for RedsMigSpice::cert_subject

Jonathon Jongsma jjongsma at redhat.com
Mon Sep 18 22:02:27 UTC 2017


Acked-by: Jonathon Jongsma <jjongsma at redhat.com>


On Mon, 2017-09-11 at 16:15 +0100, Frediano Ziglio wrote:
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
>  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 d1fe8bd7d..eca857f6b 100644
> --- a/server/main-channel.c
> +++ b/server/main-channel.c
> @@ -139,9 +139,9 @@ static void
> main_channel_fill_mig_target(MainChannel *main_channel, RedsMigSpice
>      spice_assert(mig_target);
>      g_free(main_channel->mig_target.host);
>      main_channel->mig_target.host = g_strdup(mig_target->host);
> -    free(main_channel->mig_target.cert_subject);
> +    g_free(main_channel->mig_target.cert_subject);
>      if (mig_target->cert_subject) {
> -        main_channel->mig_target.cert_subject =
> spice_strdup(mig_target->cert_subject);
> +        main_channel->mig_target.cert_subject = g_strdup(mig_target-
> >cert_subject);
>      } else {
>          main_channel->mig_target.cert_subject = NULL;
>      }
> diff --git a/server/reds.c b/server/reds.c
> index 8906708d1..05fb8fe9f 100644
> --- a/server/reds.c
> +++ b/server/reds.c
> @@ -2962,7 +2962,7 @@ static void
> reds_set_one_channel_security(RedsState *reds, int id, uint32_t secu
>  static void reds_mig_release(RedServerConfig *config)
>  {
>      if (config->mig_spice) {
> -        free(config->mig_spice->cert_subject);
> +        g_free(config->mig_spice->cert_subject);
>          g_free(config->mig_spice->host);
>          g_free(config->mig_spice);
>          config->mig_spice = NULL;
> @@ -4118,7 +4118,7 @@ static int
> reds_set_migration_dest_info(RedsState *reds,
>      spice_migration->sport = secure_port;
>      spice_migration->host = g_strdup(dest);
>      if (cert_subject) {
> -        spice_migration->cert_subject = spice_strdup(cert_subject);
> +        spice_migration->cert_subject = g_strdup(cert_subject);
>      }
>  
>      reds->config->mig_spice = spice_migration;


More information about the Spice-devel mailing list