mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-17 10:27:41 +00:00
do not dereference NULL upon failed strdup
* nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup. (ns_get_family): Likewise.
This commit is contained in:
parent
d8e2b5ba62
commit
6ca3801d0e
2 changed files with 8 additions and 3 deletions
|
|
@ -1,3 +1,9 @@
|
|||
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. */);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue