OSX: fix 1 leak ( found and fixed by marcclintdion ) and 1 possible leak in dragndrop, backport to 2.74

This commit is contained in:
Jens Verwiebe
2015-03-22 19:29:31 +01:00
parent e7d051043d
commit 059d5bc809
2 changed files with 5 additions and 1 deletions

View File

@@ -112,6 +112,7 @@ public:
for (i = 0; i < strArray->count; i++)
free(strArray->strings[i]);
free(strArray->strings);
free(strArray);
}
break;

View File

@@ -882,7 +882,10 @@ GHOST_TSuccess GHOST_SystemCocoa::handleDraggingEvent(GHOST_TEventType eventType
if (!strArray) return GHOST_kFailure;
strArray->count = [droppedArray count];
if (strArray->count == 0) return GHOST_kFailure;
if (strArray->count == 0) {
free(strArray);
return GHOST_kFailure;
}
strArray->strings = (GHOST_TUns8**) malloc(strArray->count*sizeof(GHOST_TUns8*));