From 3e44748ebe1524aef6feb01c42d342e8a2d77d34 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 9 Aug 2017 22:09:01 -0700 Subject: [PATCH] [util] Fix two other Coverity warnings --- util/options.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/util/options.cc b/util/options.cc index 452b0ce85..f4c111194 100644 --- a/util/options.cc +++ b/util/options.cc @@ -240,6 +240,8 @@ parse_features (const char *name G_GNUC_UNUSED, } while (p); shape_opts->features = (hb_feature_t *) calloc (shape_opts->num_features, sizeof (*shape_opts->features)); + if (!shape_opts->features) + return false; /* now do the actual parsing */ p = s; @@ -281,6 +283,8 @@ parse_variations (const char *name G_GNUC_UNUSED, } while (p); font_opts->variations = (hb_variation_t *) calloc (font_opts->num_variations, sizeof (*font_opts->variations)); + if (!font_opts->variations) + return false; /* now do the actual parsing */ p = s;