From 1cd49f75aa0dd71a1df44a1740dd4c15fe5656cf Mon Sep 17 00:00:00 2001 From: aunsane Date: Sat, 24 Feb 2018 15:19:44 +0300 Subject: SendSS: Reworking settings (#1144) CloudFile: fix upload service Db_autobackups: fix build --- plugins/ExternalAPI/m_cloudfile.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'plugins/ExternalAPI') 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) -- cgit v1.2.3