changeset 36654:b1ef9c82a90c

Revise non-FreeType part of mplayerLoadFont(). Fix memory leaks. Free return value of get_path() and old font_name.
author ib
date Sun, 26 Jan 2014 17:01:14 +0000
parents 123bf21dc4ea
children 31bc4f268ac2
files gui/interface.c
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/gui/interface.c	Sun Jan 26 16:57:18 2014 +0000
+++ b/gui/interface.c	Sun Jan 26 17:01:14 2014 +0000
@@ -1095,7 +1095,10 @@
         if (!vo_font)
             gmp_msg(MSGT_GPLAYER, MSGL_ERR, MSGTR_CantLoadFont, font_name);
     } else {
-        font_name = gstrdup(get_path("font/font.desc"));
+        char *fname = get_path("font/font.desc");
+
+        setdup(&font_name, fname);
+        free(fname);
         vo_font   = read_font_desc(font_name, font_factor, 0);
 
         if (!vo_font) {