summaryrefslogtreecommitdiff
path: root/src/fontcache.cpp
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2007-03-28 14:31:52 +0000
committerglx <glx@openttd.org>2007-03-28 14:31:52 +0000
commit79e97494dc0cb0ffe78f785250dbd83054637279 (patch)
treebe092b0a59a8d5778f5aa8c4e0df5d0a14228039 /src/fontcache.cpp
parent8b8f20c216b6212d1901ba13e310ea4b792cb834 (diff)
downloadopenttd-79e97494dc0cb0ffe78f785250dbd83054637279.tar.xz
(svn r9519) -Fix r7406 (revert r9518): free the malloced variable, not a pointer to that variable. Also free it if there's any error.
Diffstat (limited to 'src/fontcache.cpp')
-rw-r--r--src/fontcache.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/fontcache.cpp b/src/fontcache.cpp
index 47eaf9284..36a0c6523 100644
--- a/src/fontcache.cpp
+++ b/src/fontcache.cpp
@@ -146,11 +146,11 @@ static FT_Error GetFontByFaceName(const char *font_name, FT_Face *face)
} while ((FT_Long)++index != (*face)->num_faces);
-#if defined(UNICODE)
- free(font_path);
-#endif
folder_error:
registry_no_font_found:
+#if defined(UNICODE)
+ free(font_namep);
+#endif
RegCloseKey(hKey);
return err;
}