[Bf-blender-cvs] [059d5bc] master: OSX: fix 1 leak ( found and fixed by marcclintdion ) and 1 possible leak in dragndrop, backport to 2.74
Jens Verwiebe
noreply at git.blender.org
Sun Mar 22 19:29:51 CET 2015
Commit: 059d5bc80988320dca9cc2797d7bddc75ba0b82f
Author: Jens Verwiebe
Date: Sun Mar 22 19:29:31 2015 +0100
Branches: master
https://developer.blender.org/rB059d5bc80988320dca9cc2797d7bddc75ba0b82f
OSX: fix 1 leak ( found and fixed by marcclintdion ) and 1 possible leak in dragndrop, backport to 2.74
===================================================================
M intern/ghost/intern/GHOST_EventDragnDrop.h
M intern/ghost/intern/GHOST_SystemCocoa.mm
===================================================================
diff --git a/intern/ghost/intern/GHOST_EventDragnDrop.h b/intern/ghost/intern/GHOST_EventDragnDrop.h
index c51f956..b7bf37c 100644
--- a/intern/ghost/intern/GHOST_EventDragnDrop.h
+++ b/intern/ghost/intern/GHOST_EventDragnDrop.h
@@ -112,6 +112,7 @@ public:
for (i = 0; i < strArray->count; i++)
free(strArray->strings[i]);
+ free(strArray->strings);
free(strArray);
}
break;
diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm b/intern/ghost/intern/GHOST_SystemCocoa.mm
index 095c738..ed1200b 100644
--- a/intern/ghost/intern/GHOST_SystemCocoa.mm
+++ b/intern/ghost/intern/GHOST_SystemCocoa.mm
@@ -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*));
More information about the Bf-blender-cvs
mailing list