mirror of
https://github.com/jmcnamara/libxlsxwriter.git
synced 2026-05-15 14:15:54 -06:00
Free memory in doc properties tests and example.
This commit is contained in:
parent
d2ed216dc3
commit
6124642104
3 changed files with 27 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,5 +21,8 @@ int main() {
|
|||
|
||||
(void)worksheet;
|
||||
|
||||
free(properties->hyperlink_base);
|
||||
free(properties);
|
||||
|
||||
return workbook_close(workbook);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue