ODS Reader: fix uninitialised variables 20120219030503/pspp
authorJohn Darrington <john@darrington.wattle.id.au>
Sun, 19 Feb 2012 08:48:31 +0000 (09:48 +0100)
committerJohn Darrington <john@darrington.wattle.id.au>
Sun, 19 Feb 2012 08:48:31 +0000 (09:48 +0100)
src/data/ods-reader.c

index ea8b9ad56b62fa279116a21703cfaf529ec747ec..122e98c76d90060da92d7e79bca19adcc2599ff0 100644 (file)
@@ -411,8 +411,10 @@ ods_open_reader (struct spreadsheet_read_info *gri, struct dictionary **dict)
   /* If CELLRANGE was given, then we know how many variables should be read */
   if ( r->stop_col != -1 )
     {
+      assert (var_spec == NULL);
       n_var_specs =  r->stop_col - r->start_col + 1;
       var_spec = xrealloc (var_spec, sizeof (*var_spec) * n_var_specs);
+      memset (var_spec, '\0', sizeof (*var_spec) * n_var_specs);
     }