From 5255e872971f24de03b256de2d6dfd9cd0aab159 Mon Sep 17 00:00:00 2001 From: Tobias Weimer Date: Sun, 4 Nov 2012 14:52:06 +0000 Subject: - forgotten mir_free - warning message when we cannot retrieve path setting (this should never happen oO) git-svn-id: http://svn.miranda-ng.org/main/trunk@2182 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/SendScreenshotPlus/src/Main.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'plugins') diff --git a/plugins/SendScreenshotPlus/src/Main.cpp b/plugins/SendScreenshotPlus/src/Main.cpp index 5b855c7972..393406a91e 100644 --- a/plugins/SendScreenshotPlus/src/Main.cpp +++ b/plugins/SendScreenshotPlus/src/Main.cpp @@ -354,12 +354,18 @@ LPTSTR GetCustomPath() { mir_freeAndNil(pszPath); pszPath = mir_tstrdup(szPath); } + if(pszPath == NULL) + { + MessageBox(NULL, _T("Can not retrieve Screenshot path."), _T("Send Screenshot"), MB_OK | MB_ICONERROR | MB_APPLMODAL); + return 0; + } INT_PTR result = CallService(MS_UTILS_CREATEDIRTREET,0,(LPARAM) pszPath); if(result != NULL) { TCHAR szError[MAX_PATH]; mir_sntprintf(szError,MAX_PATH,TranslateT("Could not create Screenshot folder (error code: %d):\n%s\nDo you have write permissions?"),result,pszPath); MessageBox(NULL, szError, _T("Send Screenshot"), MB_OK | MB_ICONERROR | MB_APPLMODAL); + mir_free(pszPath); return 0; } return pszPath; -- cgit v1.2.3