Fixed a use after free error when manipulating datasets.
authorJohn Darrington <john@darrington.wattle.id.au>
Sat, 20 Jun 2020 05:17:06 +0000 (07:17 +0200)
committerJohn Darrington <john@darrington.wattle.id.au>
Sat, 20 Jun 2020 05:18:19 +0000 (07:18 +0200)
Reported by: Andrea Fioraldi

Fixes bug: #58598

src/data/dataset.c

index b94a3675c6668ac4ce4ae6362c7db145d58846f3..12fc4a20fdbf3f73d29aad071c0b7aed4d74766e 100644 (file)
@@ -293,7 +293,7 @@ dataset_set_dict (struct dataset *ds, struct dictionary *dict)
   dataset_clear (ds);
 
   dict_unref (ds->dict);
-  ds->dict = dict;
+  ds->dict = dict_ref (dict);
   dict_set_change_callback (ds->dict, dict_callback, ds);
 }