OSX: fix 1 leak ( found and fixed by marcclintdion ) and 1 possible leak in dragndrop...
authorJens Verwiebe <info@jensverwiebe.de>
Sun, 22 Mar 2015 18:29:31 +0000 (19:29 +0100)
committerJens Verwiebe <info@jensverwiebe.de>
Sun, 22 Mar 2015 18:29:42 +0000 (19:29 +0100)
intern/ghost/intern/GHOST_EventDragnDrop.h
intern/ghost/intern/GHOST_SystemCocoa.mm

index c51f95680872e87e153886a7a5ecca5d6e4f8e8e..b7bf37c99d835bed42cc1a850c9e2996a480bcca 100644 (file)
@@ -112,6 +112,7 @@ public:
                                for (i = 0; i < strArray->count; i++)
                                        free(strArray->strings[i]);
                                
+                               free(strArray->strings);
                                free(strArray);
                        }
                        break;
index 095c738e1e0864747fbb2e04dcad45e7f9bc4495..ed1200b967ce5da37b2fca825f481349133c344d 100644 (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*));