Commit 6ca3801d authored by Jim Meyering's avatar Jim Meyering
Browse files

do not dereference NULL upon failed strdup

* nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
(ns_get_family): Likewise.
parent d8e2b5ba
2011-04-02 Jim Meyering <meyering@redhat.com>
do not dereference NULL upon failed strdup
* nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
(ns_get_family): Likewise.
2011-04-02 Juanma Barranquero <lekktu@gmail.com>
* eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
......@@ -100,7 +100,7 @@ static void ns_glyph_metrics (struct nsfont_info *font_info,
return nil;
else
{
char *tmp = strdup (SDATA (SYMBOL_NAME (tem)));
char *tmp = xstrdup (SDATA (SYMBOL_NAME (tem)));
NSString *family;
ns_unescape_name (tmp);
family = [NSString stringWithUTF8String: tmp];
......@@ -176,7 +176,7 @@ static void ns_glyph_metrics (struct nsfont_info *font_info,
if (family == nil)
family = [[NSFont userFixedPitchFontOfSize: 0] familyName];
escapedFamily = strdup ([family UTF8String]);
escapedFamily = xstrdup ([family UTF8String]);
ns_escape_name (escapedFamily);
ASET (font_entity, FONT_TYPE_INDEX, Qns);
......@@ -1526,4 +1526,3 @@ - (void)setIntAttribute: (NSInteger)attributeTag value: (NSInteger)val
DEFVAR_LISP ("ns-reg-to-script", Vns_reg_to_script,
doc: /* Internal use: maps font registry to unicode script. */);
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment