diff options
author | Grigori Goronzy <greg@chown.ath.cx> | 2015-09-07 11:06:17 +0200 |
---|---|---|
committer | Grigori Goronzy <greg@chown.ath.cx> | 2015-09-07 11:07:27 +0200 |
commit | d6bb9af645526a810512eaf2c65252ac0e0e6b36 (patch) | |
tree | f421fa82ffeec2c8a4fd10a3a17f6d87fd6977a6 /libass | |
parent | af6a9194b19f3073e7044c48635f1adc332fca05 (diff) | |
download | libass-d6bb9af645526a810512eaf2c65252ac0e0e6b36.tar.bz2 libass-d6bb9af645526a810512eaf2c65252ac0e0e6b36.tar.xz |
fontselect: get rid of strdup for display name
The name is always pulled from the font info, which is static, so
there is no need to strdup.
Diffstat (limited to 'libass')
-rw-r--r-- | libass/ass_font.c | 5 | ||||
-rw-r--r-- | libass/ass_fontselect.c | 6 |
2 files changed, 3 insertions, 8 deletions
diff --git a/libass/ass_font.c b/libass/ass_font.c index 0164b67..b3c639d 100644 --- a/libass/ass_font.c +++ b/libass/ass_font.c @@ -153,7 +153,6 @@ static int add_face(ASS_FontSelector *fontsel, ASS_Font *font, uint32_t ch) if (font->faces_uid[i] == uid) { ass_msg(font->library, MSGL_INFO, "Got a font face that already is available! Skipping."); - free(path); return i; } } @@ -178,7 +177,6 @@ static int add_face(ASS_FontSelector *fontsel, ASS_Font *font, uint32_t ch) if (error) { ass_msg(font->library, MSGL_WARN, "Error opening memory font: '%s'", path); - free(path); return -1; } @@ -187,7 +185,6 @@ static int add_face(ASS_FontSelector *fontsel, ASS_Font *font, uint32_t ch) if (error) { ass_msg(font->library, MSGL_WARN, "Error opening font: '%s', %d", path, index); - free(path); return -1; } @@ -201,7 +198,6 @@ static int add_face(ASS_FontSelector *fontsel, ASS_Font *font, uint32_t ch) if (error) { ass_msg(font->library, MSGL_WARN, "Error opening font: '%s', %d", path, i); - free(path); return -1; } @@ -217,7 +213,6 @@ static int add_face(ASS_FontSelector *fontsel, ASS_Font *font, uint32_t ch) font->faces[font->n_faces] = face; font->faces_uid[font->n_faces++] = uid; ass_face_set_size(face, font->size); - free(path); return font->n_faces - 1; } diff --git a/libass/ass_fontselect.c b/libass/ass_fontselect.c index 2be6549..d48b170 100644 --- a/libass/ass_fontselect.c +++ b/libass/ass_fontselect.c @@ -564,11 +564,11 @@ find_font(ASS_FontSelector *priv, ASS_Library *library, // used for display purposes so it doesn't matter that much, // though. if (selected->postscript_name) - result = strdup(selected->postscript_name); + result = selected->postscript_name; else - result = strdup(selected->families[0]); + result = selected->families[0]; } else - result = strdup(selected->path); + result = selected->path; } return result; |