Fix memory leak
authorJohn Darrington <john@darrington.wattle.id.au>
Tue, 5 Sep 2017 06:01:39 +0000 (08:01 +0200)
committerJohn Darrington <john@darrington.wattle.id.au>
Tue, 5 Sep 2017 06:01:39 +0000 (08:01 +0200)
src/ui/gui/psppire-data-editor.c

index 0efd8ce835186de958d58e28f704b1ff9c38e83d..a3431349b186ecb4749c1d18859f7db7fc56ff72 100644 (file)
@@ -355,12 +355,14 @@ on_datum_entry_activate (GtkEntry *entry, PsppireDataEditor *de)
       if (var == NULL)
        return;
 
-      value_init (&val, var_get_width (var));
-
-      if (psppire_value_entry_get_value (de->datum_entry, &val, var_get_width (var)))
+      int width = var_get_width (var);
+      value_init (&val, width);
+      if (psppire_value_entry_get_value (PSPPIRE_VALUE_ENTRY (de->datum_entry),
+                                        &val, width))
        {
          psppire_data_store_set_value (de->data_store, row, var, &val);
        }
+      value_destroy (&val, width);
     }
 }