[DESK.CPL]: Check properly if the StringCbCopy has been copied correctly just by moving the check block to where it belongs.

CID 1322244
Patch by Victor Martinez Calvo
CORE-11212 #resolve

svn path=/trunk/; revision=71493
This commit is contained in:
Hermès Bélusca-Maïto 2016-06-01 21:23:37 +00:00
parent 91c6b947d3
commit 9afc56b93b

View file

@ -19,7 +19,7 @@
#define PLACEMENT_STRETCH 1 #define PLACEMENT_STRETCH 1
#define PLACEMENT_TILE 2 #define PLACEMENT_TILE 2
/* The values in these macros are dependant on the /* The values in these macros are dependent on the
* layout of the monitor image and they must be adjusted * layout of the monitor image and they must be adjusted
* if that image will be changed. * if that image will be changed.
*/ */
@ -348,12 +348,11 @@ AddListViewItems(HWND hwndDlg, PDATA pData)
if ((result == ERROR_SUCCESS) && (_tcslen(originalWallpaper) > 0)) if ((result == ERROR_SUCCESS) && (_tcslen(originalWallpaper) > 0))
{ {
hr = StringCbCopy(wallpaperFilename, sizeof(wallpaperFilename), originalWallpaper); hr = StringCbCopy(wallpaperFilename, sizeof(wallpaperFilename), originalWallpaper);
} if (FAILED(hr))
{
if (FAILED(hr)) RegCloseKey(regKey);
{ return;
RegCloseKey(regKey); }
return;
} }
} }