pspp-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pspp-cvs] pspp/src/data ChangeLog dictionary.c


From: Ben Pfaff
Subject: [Pspp-cvs] pspp/src/data ChangeLog dictionary.c
Date: Mon, 23 Apr 2007 01:32:29 +0000

CVSROOT:        /cvsroot/pspp
Module name:    pspp
Changes by:     Ben Pfaff <blp> 07/04/23 01:32:29

Modified files:
        src/data       : ChangeLog dictionary.c 

Log message:
        Patch #5885.
        
        (dict_set_split_vars): dict_destroy expects that
        dict_clear will free most data related to the dictionary.
        dict_clear does a decent job, except that dict_set_split_vars on
        some systems won't actually free the dict's "split" member.
        Instead, it'll allocate a 1-byte region.  Fix this.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/pspp/src/data/ChangeLog?cvsroot=pspp&r1=1.113&r2=1.114
http://cvs.savannah.gnu.org/viewcvs/pspp/src/data/dictionary.c?cvsroot=pspp&r1=1.34&r2=1.35

Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/pspp/pspp/src/data/ChangeLog,v
retrieving revision 1.113
retrieving revision 1.114
diff -u -b -r1.113 -r1.114
--- ChangeLog   23 Apr 2007 01:30:22 -0000      1.113
+++ ChangeLog   23 Apr 2007 01:32:29 -0000      1.114
@@ -1,5 +1,11 @@
 2007-04-22  Ben Pfaff  <address@hidden>
 
+       * dictionary.c (dict_set_split_vars): dict_destroy expects that
+       dict_clear will free most data related to the dictionary.
+       dict_clear does a decent job, except that dict_set_split_vars on
+       some systems won't actually free the dict's "split" member.
+       Instead, it'll allocate a 1-byte region.  Fix this.
+
        * value.c (value_copy): New function.
        (value_set_missing): Ditto.
 

Index: dictionary.c
===================================================================
RCS file: /cvsroot/pspp/pspp/src/data/dictionary.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -b -r1.34 -r1.35
--- dictionary.c        22 Apr 2007 00:48:50 -0000      1.34
+++ dictionary.c        23 Apr 2007 01:32:29 -0000      1.35
@@ -444,11 +444,12 @@
 /* Deletes variable V from dictionary D and frees V.
 
    This is a very bad idea if there might be any pointers to V
-   from outside D.  In general, no variable in should be deleted when
-   any transformations are active on the dictionary's dataset, because
-   those transformations might reference the deleted variable.
-   The safest time to delete a variable is just after a procedure
-   has been executed, as done by MODIFY VARS.
+   from outside D.  In general, no variable in the active file's
+   dictionary should be deleted when any transformations are
+   active on the dictionary's dataset, because those
+   transformations might reference the deleted variable.  The
+   safest time to delete a variable is just after a procedure has
+   been executed, as done by MODIFY VARS.
 
    Pointers to V within D are not a problem, because
    dict_delete_var() knows to remove V from split variables,
@@ -1057,7 +1058,7 @@
   assert (cnt == 0 || split != NULL);
 
   d->split_cnt = cnt;
-  d->split = xnrealloc (d->split, cnt, sizeof *d->split);
+  d->split = cnt > 0 ? xnrealloc (d->split, cnt, sizeof *d->split) : NULL;
   memcpy (d->split, split, cnt * sizeof *d->split);
 
   if ( d->callbacks &&  d->callbacks->split_changed )




reply via email to

[Prev in Thread] Current Thread [Next in Thread]