diff --git a/src/apps/icon-o-matic/import_export/styled_text/StyledTextImporter.cpp b/src/apps/icon-o-matic/import_export/styled_text/StyledTextImporter.cpp index 1b8e6285e8..37ac3a65ae 100644 --- a/src/apps/icon-o-matic/import_export/styled_text/StyledTextImporter.cpp +++ b/src/apps/icon-o-matic/import_export/styled_text/StyledTextImporter.cpp @@ -320,8 +320,10 @@ StyledTextImporter::_Import(Icon* icon, const char *text, text_run_array *runs) //offset.x += glyph.Bounds().Width(); offset.x += charWidth; Shape* shape = new (nothrow) Shape(NULL); + if (shape == NULL) + return B_NO_MEMORY; shape->SetName(glyphName.String()); - if (!shape || !icon->Shapes()->AddShape(shape)) { + if (!icon->Shapes()->AddShape(shape)) { delete shape; return B_NO_MEMORY; }