Maelstrom: Valgrind fixes

https://github.com/libsdl-org/Maelstrom/commit/2c66aa08d0d72cde6fbcf66cbd95a880c7d9fb3e

From 2c66aa08d0d72cde6fbcf66cbd95a880c7d9fb3e Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Mon, 24 Oct 2011 23:28:17 -0400
Subject: [PATCH] Valgrind fixes

---
 UIElementKeyButton.cpp  | 1 +
 maclib/Mac_FontServ.cpp | 6 ++++--
 maclib/Mac_FontServ.h   | 2 +-
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/UIElementKeyButton.cpp b/UIElementKeyButton.cpp
index 0182d55c..1177b621 100644
--- a/UIElementKeyButton.cpp
+++ b/UIElementKeyButton.cpp
@@ -31,6 +31,7 @@ UIElementKeyButton::Load(rapidxml::xml_node<> *node)
 		m_text = fontserv->TextImage(SDL_GetKeyName(m_hotkey),
 				fonts[GENEVA_9], STYLE_BOLD, 0xFF, 0xFF, 0xFF);
 	}
+	return true;
 }
 
 void
diff --git a/maclib/Mac_FontServ.cpp b/maclib/Mac_FontServ.cpp
index 1bf211c7..7a1f684d 100644
--- a/maclib/Mac_FontServ.cpp
+++ b/maclib/Mac_FontServ.cpp
@@ -157,7 +157,8 @@ FontServ:: NewFont(const char *fontname, int ptsize)
 
 	/* Now, Fent.ID is the ID of the correct NFNT resource */
 	font = new MFont;
-	font->name = fontname;
+	font->name = new char[strlen(fontname)+1];
+	strcpy(font->name, fontname);
 	font->ptsize = ptsize;
 	font->nfnt = fontres->Resource("NFNT", Fent.ID);
 	if ( font->nfnt == NULL ) {
@@ -219,6 +220,7 @@ FontServ:: NewFont(const char *fontname, int ptsize)
 void
 FontServ:: FreeFont(MFont *font)
 {
+	delete[] font->name;
 	delete font;
 }
 
@@ -295,7 +297,7 @@ FontServ:: TextImage(const char *text, MFont *font, Uint8 style, SDL_Color fg)
 	/* First see if we can find it in our cache */
 	keysize = strlen(font->name)+1+2+1+1+1+strlen(text)+1;
 	key = SDL_stack_alloc(char, keysize);
-	sprintf(key, "%s:%d:%d:%s", font->name, font->ptsize, '0'+style, text);
+	sprintf(key, "%s:%d:%c:%s", font->name, font->ptsize, '0'+style, text);
 	if (hash_find(strings, key, (const void**)&image)) {
 		SDL_SetTextureColorMod(image, fg.r, fg.g, fg.b);
 		return image;
diff --git a/maclib/Mac_FontServ.h b/maclib/Mac_FontServ.h
index f81936ee..ee8abd05 100644
--- a/maclib/Mac_FontServ.h
+++ b/maclib/Mac_FontServ.h
@@ -72,7 +72,7 @@ struct FontHdr {
 };
 
 typedef struct MFont {
-	const char *name;
+	char *name;
 	int ptsize;
 	struct FontHdr *header;		/* The NFNT header! */