On Fri, 4 Jul 2008, Allin Cottrell wrote:
On Fri, 4 Jul 2008, Allin Cottrell wrote:
> A brief warning on the current state of gretl CVS... I noticed
> today that my work on [something new] has broken the handling of
> models saved in session files: you are likely to get memory
> corruption on exiting gretl when such models are freed.
This should be fixed now.
I believe the patch below necessary too. However, not all problems are
solved. Allin, I'm sending you a session file from Artur with a more
in-depth analysis; I'm not sending this to the list cause I believe sane
people (as far as econometricians can be considered sane people) are not
overly passionate about the gory details.
Index: lib/src/gretl_model.c
===================================================================
RCS file: /cvsroot/gretl/gretl/lib/src/gretl_model.c,v
retrieving revision 1.239
diff -u -r1.239 gretl_model.c
--- lib/src/gretl_model.c 4 Jul 2008 15:58:47 -0000 1.239
+++ lib/src/gretl_model.c 4 Jul 2008 16:32:54 -0000
@@ -2435,6 +2435,7 @@
{
ModelTest test;
xmlNodePtr cur = node->xmlChildrenNode;
+ char *paramname = NULL;
int got, err = 0;
gretl_test_init(&test, 0);
@@ -2456,7 +2457,11 @@
} else {
err = real_add_test_to_model(pmod, &test);
}
- free(test.param);
+
+ if (paramname != NULL) {
+ strcpy(paramname, test.param);
+ free(paramname);
+ }
cur = cur->next;
}
Riccardo (Jack) Lucchetti
Dipartimento di Economia
Università Politecnica delle Marche
r.lucchetti(a)univpm.it
http://www.econ.univpm.it/lucchetti