Free memory in doc properties tests and example.

This commit is contained in:
John McNamara 2015-12-13 23:27:15 +00:00
parent d2ed216dc3
commit 6124642104
3 changed files with 27 additions and 1 deletions

View file

@ -34,8 +34,20 @@ int main() {
worksheet_write_string(worksheet, 0, 0,
"Select 'Workbook Properties' to see properties." , NULL);
workbook_close(workbook);
workbook_close(workbook);
/* Clean up memory used for properties. */
free(properties->title);
free(properties->subject);
free(properties->author);
free(properties->manager);
free(properties->company);
free(properties->category);
free(properties->keywords);
free(properties->comments);
free(properties->status);
free(properties);
return 0;
}

View file

@ -30,5 +30,16 @@ int main() {
worksheet_set_column(worksheet, 0, 0, 70, NULL, NULL);
worksheet_write_string(worksheet, CELL("A1"), "Select 'Office Button -> Prepare -> Properties' to see the file properties." , NULL);
free(properties->title);
free(properties->subject);
free(properties->author);
free(properties->manager);
free(properties->company);
free(properties->category);
free(properties->keywords);
free(properties->comments);
free(properties->status);
free(properties);
return workbook_close(workbook);
}

View file

@ -21,5 +21,8 @@ int main() {
(void)worksheet;
free(properties->hyperlink_base);
free(properties);
return workbook_close(workbook);
}