On Sun, Sep 23, 2018 at 03:02:35PM +0200, John Darrington wrote:
> diff --git a/src/data/dataset.c b/src/data/dataset.c
> index 7a5a6a4a..15774eec 100644
> --- a/src/data/dataset.c
> +++ b/src/data/dataset.c
> @@ -293,7 +293,8 @@ dataset_set_dict (struct dataset *ds, struct dictionary 
> *dict)
>    dataset_clear (ds);
>  
>    dict_destroy (ds->dict);
> -  ds->dict = dict;
> +  ds->dict = dict_clone (dict);
> +
>    dict_set_change_callback (ds->dict, dict_callback, ds);
>  }

The above is not obviously to me a safe change.

The caller might assume that the dictionary passed in is actually going
to be used as the dictionary; did you check whether the callers rely on
that?

Also, currently the dictionary takes ownership of the dictionary
argument, I believe, and it appears to me that this will leak that
dictionary.

_______________________________________________
pspp-dev mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/pspp-dev

Reply via email to