diff options
Diffstat (limited to 'Build/source/texk/web2c/luatexdir/luafontloader/src/luafflib.c')
-rw-r--r-- | Build/source/texk/web2c/luatexdir/luafontloader/src/luafflib.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/src/luafflib.c b/Build/source/texk/web2c/luatexdir/luafontloader/src/luafflib.c index 61a2e79349f..f932c3d9946 100644 --- a/Build/source/texk/web2c/luatexdir/luafontloader/src/luafflib.c +++ b/Build/source/texk/web2c/luatexdir/luafontloader/src/luafflib.c @@ -301,8 +301,9 @@ static int ff_apply_featurefile(lua_State * L) SplineFont **sf; char *fname; sf = check_isfont(L, 1); - fname = (char *) luaL_checkstring(L, 2); + fname = xstrdup(luaL_checkstring(L, 2)); SFApplyFeatureFilename(*sf, fname); + free(fname); if (gww_error_count > 0) { int i; lua_newtable(L); @@ -320,9 +321,9 @@ static int ff_apply_featurefile(lua_State * L) static int ff_apply_afmfile(lua_State * L) { SplineFont **sf; - char *fname; + const char *fname; sf = check_isfont(L, 1); - fname = (char *) luaL_checkstring(L, 2); + fname = luaL_checkstring(L, 2); CheckAfmOfPostscript(*sf, fname, (*sf)->map); if (gww_error_count > 0) { int i; @@ -3227,6 +3228,7 @@ static int ff_info(lua_State * L) FILE *l; int i; const char *fontname; + char *fontnamecopy; int openflags = 1; fontname = luaL_checkstring(L, 1); if (!strlen(fontname)) { @@ -3247,7 +3249,9 @@ static int ff_info(lua_State * L) } gww_error_count = 0; - sf = ReadSplineFontInfo((char *) fontname, openflags); + fontnamecopy = xstrdup(fontname); + sf = ReadSplineFontInfo(fontnamecopy, openflags); + free(fontnamecopy); if (gww_error_count > 0) gwwv_errors_free(); |