From 83175da4b297af6c46954ded3b4cd4f476302104 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 4 Apr 2011 10:59:57 -0600 Subject: [PATCH] ... --- src/calibre/ebooks/pdf/fonts.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/calibre/ebooks/pdf/fonts.cpp b/src/calibre/ebooks/pdf/fonts.cpp index 9b9e7708a3..c5261298ff 100644 --- a/src/calibre/ebooks/pdf/fonts.cpp +++ b/src/calibre/ebooks/pdf/fonts.cpp @@ -136,13 +136,9 @@ Fonts::size_type Fonts::add_font(XMLFont *f) { Fonts::size_type Fonts::add_font(string* font_name, double size, GfxRGB rgb) { XMLFont *f = NULL; - if (font_name == NULL) { - string *fn = new string("Unknown"); - f = new XMLFont(fn, size, rgb); - // fn must not be deleted - } else { - f = new XMLFont(font_name, size, rgb); - } + if (font_name == NULL) + font_name = new string("Unknown"); + f = new XMLFont(font_name, size, rgb); return this->add_font(f); }