X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdata%2Fods-reader.c;h=170c005739b9eed6070465743d20ac4de521bab9;hb=refs%2Fbuilds%2F20120823001911%2Fpspp;hp=122e98c76d90060da92d7e79bca19adcc2599ff0;hpb=0ae9a2d50982969c4d9627864f79a0e17191a1b7;p=pspp diff --git a/src/data/ods-reader.c b/src/data/ods-reader.c index 122e98c76d..170c005739 100644 --- a/src/data/ods-reader.c +++ b/src/data/ods-reader.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 2011 Free Software Foundation, Inc. + Copyright (C) 2011, 2012 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -324,11 +324,11 @@ convert_xml_to_value (struct ccase *c, const struct variable *var, text = xmv->value ? CHAR_CAST (const char *, xmv->value) : CHAR_CAST (const char *, xmv->text); - data_in (ss_cstr (text), "UTF-8", - fmt->type, - v, - var_get_width (var), - "UTF-8"); + free (data_in (ss_cstr (text), "UTF-8", + fmt->type, + v, + var_get_width (var), + "UTF-8")); } } @@ -462,7 +462,7 @@ ods_open_reader (struct spreadsheet_read_info *gri, struct dictionary **dict) var_spec = xrealloc (var_spec, sizeof (*var_spec) * (idx + 1)); /* xrealloc (unlike realloc) doesn't initialise its memory to 0 */ - memset (var_spec + n_var_specs * sizeof (*var_spec), + memset (var_spec + n_var_specs, 0, (n_var_specs - idx + 1) * sizeof (*var_spec)); n_var_specs = idx + 1; @@ -592,6 +592,10 @@ ods_open_reader (struct spreadsheet_read_info *gri, struct dictionary **dict) free (var_spec); + dict_destroy (r->dict); + ods_file_casereader_destroy (NULL, r); + + return NULL; }