On Wed 30 Nov 2016 02:18:33 AM CET, Max Reitz wrote:
>  int bdrv_open_backing_file(BlockDriverState *bs, QDict *parent_options,
>                             const char *bdref_key, Error **errp)
>  {
> -    char *backing_filename = g_malloc0(PATH_MAX);
> +    char *backing_filename = NULL;
>      char *bdref_key_dot;
>      const char *reference = NULL;
>      int ret = 0;
> @@ -1511,7 +1505,7 @@ int bdrv_open_backing_file(BlockDriverState *bs, QDict 
> *parent_options,
>  
>      reference = qdict_get_try_str(parent_options, bdref_key);
>      if (reference || qdict_haskey(options, "file.filename")) {
> -        backing_filename[0] = '\0';
> +        backing_filename = NULL;

You're making it NULL, but it's NULL already.

Otherwise the patch looks fine.

Berto

Reply via email to