diff options
Diffstat (limited to 'plugins/ExternalAPI/m_cloudfile.h')
-rw-r--r-- | plugins/ExternalAPI/m_cloudfile.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/plugins/ExternalAPI/m_cloudfile.h b/plugins/ExternalAPI/m_cloudfile.h index 9207546c23..505f9e3462 100644 --- a/plugins/ExternalAPI/m_cloudfile.h +++ b/plugins/ExternalAPI/m_cloudfile.h @@ -31,10 +31,20 @@ struct CFUPLOADDATA struct CFUPLOADRESULT { - char **links; - wchar_t *description; + char **links; // need to be freed manually or by calling cfur_free + size_t linkCount; + wchar_t *description; // need to be freed manually or by calling cfur_free }; +// frees allocated fields of CFUPLOADRESULT +__inline void cfur_free(CFUPLOADRESULT *ur) +{ + for (size_t i = 0; i < ur->linkCount; i++) + mir_free(ur->links[0]); + mir_free(ur->links); + mir_free(ur->description); +} + // upload file on cloud service // wParam = (WPARAM)(const CFUPLOADDATA*)uploadData // lParam = (LPARAM)(char CFUPLOADRESULT*)uploadResult (can be NULL) |