OSX: fix 1 leak ( found and fixed by marcclintdion ) and 1 possible leak in dragndrop, backport to 2.74
This commit is contained in:
@@ -112,6 +112,7 @@ public:
|
||||
for (i = 0; i < strArray->count; i++)
|
||||
free(strArray->strings[i]);
|
||||
|
||||
free(strArray->strings);
|
||||
free(strArray);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -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*));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user