summaryrefslogtreecommitdiff
path: root/plugins/FloatingContacts/src/filedrop.cpp
diff options
context:
space:
mode:
authorTobias Weimer <wishmaster51@googlemail.com>2015-02-23 16:10:53 +0000
committerTobias Weimer <wishmaster51@googlemail.com>2015-02-23 16:10:53 +0000
commit3be05c18025be1d74936f5bda36c9ee278c4ef2a (patch)
treed044b92665e57d9bef4440e38e7b6a67dccb8ff4 /plugins/FloatingContacts/src/filedrop.cpp
parentb9944684c1ca56a24b527772d3543bc3535c960a (diff)
FltContacts:
- Fixed memory leak git-svn-id: http://svn.miranda-ng.org/main/trunk@12247 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/FloatingContacts/src/filedrop.cpp')
-rw-r--r--plugins/FloatingContacts/src/filedrop.cpp25
1 files changed, 11 insertions, 14 deletions
diff --git a/plugins/FloatingContacts/src/filedrop.cpp b/plugins/FloatingContacts/src/filedrop.cpp
index 64ee8db693..586b1419aa 100644
--- a/plugins/FloatingContacts/src/filedrop.cpp
+++ b/plugins/FloatingContacts/src/filedrop.cpp
@@ -176,16 +176,20 @@ BOOL OnDropFiles( HDROP hDrop, ThumbInfo *pThumb )
char **ppFiles = ( char** )malloc( sizeof( char *)* ( nFilesCount+1));
- if ( ppFiles == NULL )
+ BOOL bSuccess = FALSE;
+ if (ppFiles != NULL)
{
- return FALSE;
- }
-
- ppFiles[ nFilesCount] = NULL;
+ ppFiles[nFilesCount] = NULL;
+
+ ProcessDroppedItems(ppDroppedItems, nDroppedItemsCount, ppFiles);
+
+ bSuccess = (BOOL)CallService(MS_CLIST_CONTACTFILESDROPPED, (WPARAM)pThumb->hContact, (LPARAM)ppFiles);
- ProcessDroppedItems( ppDroppedItems, nDroppedItemsCount, ppFiles );
+ for (UINT iItem = 0; iItem < nFilesCount ; ++iItem )
+ free(ppFiles[iItem]);
- BOOL bSuccess = (BOOL)CallService(MS_CLIST_CONTACTFILESDROPPED, (WPARAM)pThumb->hContact, (LPARAM)ppFiles );
+ free(ppFiles);
+ }
// Cleanup
for (UINT iItem = 0; ppDroppedItems[ iItem ]; ++iItem )
@@ -195,13 +199,6 @@ BOOL OnDropFiles( HDROP hDrop, ThumbInfo *pThumb )
free( ppDroppedItems );
- for (UINT iItem = 0; iItem < nFilesCount ; ++iItem )
- {
- free( ppFiles[ iItem ] );
- }
-
- free( ppFiles );
-
return bSuccess;
}