From c4f80d1ee89538565743229ceca9b7ec933dda19 Mon Sep 17 00:00:00 2001 From: Philippe Saint-Pierre Date: Tue, 15 Jul 2014 16:11:51 -0400 Subject: [PATCH] CID 1108469: Use after free --- src/apps/patchbay/EndpointInfo.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/apps/patchbay/EndpointInfo.cpp b/src/apps/patchbay/EndpointInfo.cpp index 538061ab30..4dd14dad73 100644 --- a/src/apps/patchbay/EndpointInfo.cpp +++ b/src/apps/patchbay/EndpointInfo.cpp @@ -111,8 +111,10 @@ CreateIcon(const BMessage* msg, icon_size which) bitmap) == B_OK) { printf("Created vector icon bitmap\n"); return bitmap; - } else + } else { delete bitmap; + bitmap = NULL; + } } // If not, look for BeOS style icon @@ -128,9 +130,8 @@ CreateIcon(const BMessage* msg, icon_size which) bmapSize = MINI_ICON_SIZE - 1; iconType = MINI_ICON_TYPE; iconName = MINI_ICON_NAME; - } else { + } else return NULL; - } if (msg->FindData(iconName, iconType, &data, &size) == B_OK) { bitmap = new BBitmap(BRect(0, 0, bmapSize, bmapSize),