From ed372b712fa698da24c21746135f2c2c8d738c6e Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sun, 9 Mar 2014 06:14:12 +0100 Subject: [PATCH] Fix cppcheck 1.64 warning. * src/autofit/afglobal.c (af_face_globals_new): Catch NULL pointer dereference in case of error. --- ChangeLog | 7 +++++++ src/autofit/afglobal.c | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index a19fd6fc7..4d1d4bc87 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2014-03-09 Alan Coopersmith + + Fix cppcheck 1.64 warning. + + * src/autofit/afglobal.c (af_face_globals_new): Catch NULL pointer + dereference in case of error. + 2014-03-09 Sean McBride * src/sfnt/ttcmap.c (tt_face_build_cmaps): Remove clang warning. diff --git a/src/autofit/afglobal.c b/src/autofit/afglobal.c index 7aa2e1102..74e8a727d 100644 --- a/src/autofit/afglobal.c +++ b/src/autofit/afglobal.c @@ -332,8 +332,8 @@ af_face_globals_free( globals ); globals = NULL; } - - globals->increase_x_height = AF_PROP_INCREASE_X_HEIGHT_MAX; + else + globals->increase_x_height = AF_PROP_INCREASE_X_HEIGHT_MAX; Exit: *aglobals = globals;