[Spice-devel] [PATCH x11spice 2/2] Bug fix: a listen specification from the config file was ignored

Frediano Ziglio fziglio at redhat.com
Thu Jul 18 15:06:38 UTC 2019


> 
> Signed-off-by: Jeremy White <jwhite at codeweavers.com>
> ---
>  src/options.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/src/options.c b/src/options.c
> index 0d3138d0..cf75e54e 100644
> --- a/src/options.c
> +++ b/src/options.c
> @@ -355,7 +355,9 @@ int options_parse_arguments(int argc, char *argv[],
> options_t *options)
>      if (rc == 0) {
>          if (optind >= argc) {
>              /* Default */
> -            options->listen = strdup("5900");
> +            if (!options->listen) {

Minor "if (options->listen == NULL) {". For me both are fine.

> +                options->listen = strdup("5900");

Note that in case of option this was initialized form Glib
so it's a mix of glib (which require g_free) and C strdup
(which requires free).
But this is not a regression.

> +            }
>          } else if (optind < (argc - 1)) {
>              fprintf(stderr, "Error: too many arguments\n");
>              rc = X11SPICE_ERR_BADARGS;

Otherwise, ack

Frediano


More information about the Spice-devel mailing list