Fix use of uninitialized data in table_casereader_get_cell(). fc11-i386-build77 fc11-x64-build74 sid-i386-build144
authorBen Pfaff <blp@gnu.org>
Sun, 17 Jan 2010 22:37:45 +0000 (14:37 -0800)
committerBen Pfaff <blp@gnu.org>
Sun, 17 Jan 2010 22:37:45 +0000 (14:37 -0800)
Thanks to John Darrington for pointing out the problem.

src/output/table-casereader.c

index 909a2b5fd00ad9bfcc37441c9f18880faa3e28c5..4a1452c0e91eea776b2eb4af75c57f4b2c53bdb8 100644 (file)
@@ -115,7 +115,8 @@ table_casereader_get_cell (const struct table *t, int x, int y,
     {
       if (y == 0)
         {
-          cell->contents = xstrdup (tc->heading);
+          s = xstrdup (tc->heading);
+          cell->contents = s;
           cell->destructor = free_string;
           cell->destructor_aux = s;
           return;