diff options
author | Tobias Weimer <wishmaster51@googlemail.com> | 2015-02-01 15:13:51 +0000 |
---|---|---|
committer | Tobias Weimer <wishmaster51@googlemail.com> | 2015-02-01 15:13:51 +0000 |
commit | bacebef9af7acf3220bd829e13d062187985e317 (patch) | |
tree | 9dbf528ef0bfbe6c2dc76b6622d6948f19166ac7 /protocols/MSN/src/msn_svcs.cpp | |
parent | 57a9a439a1fa94bc6c1d59230eae3a5360ff8272 (diff) |
MSN: Minor leaks fixed
git-svn-id: http://svn.miranda-ng.org/main/trunk@11973 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/MSN/src/msn_svcs.cpp')
-rw-r--r-- | protocols/MSN/src/msn_svcs.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/protocols/MSN/src/msn_svcs.cpp b/protocols/MSN/src/msn_svcs.cpp index c7beb43a5a..61161e0ea2 100644 --- a/protocols/MSN/src/msn_svcs.cpp +++ b/protocols/MSN/src/msn_svcs.cpp @@ -198,15 +198,15 @@ INT_PTR CMsnProto::SetAvatar(WPARAM, LPARAM lParam) size_t dwPngSize = _filelengthi64(fileId);
unsigned char* pData = (unsigned char*)mir_alloc(dwPngSize);
- if (pData == NULL) return 2;
+ if (pData == NULL) {
+ _close(fileId);
+ return 2;
+ }
_read(fileId, pData, (unsigned)dwPngSize);
_close(fileId);
- TCHAR drive[_MAX_DRIVE];
- TCHAR dir[_MAX_DIR];
- TCHAR fname[_MAX_FNAME];
- TCHAR ext[_MAX_EXT];
+ TCHAR drive[_MAX_DRIVE], dir[_MAX_DIR], fname[_MAX_FNAME], ext[_MAX_EXT];
_tsplitpath(szFileName, drive, dir, fname, ext);
MSN_SetMyAvatar(fname, pData, dwPngSize);
|