From: Ben Key Date: Sat, 16 Apr 2011 03:14:08 +0000 (-0500) Subject: Fixed bugs in ns_get_family and ns_descriptor_to_entity that were caused by using... X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~274 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=613052cdfe876e3e51b02c3fc72d04f3da63305b;p=emacs.git Fixed bugs in ns_get_family and ns_descriptor_to_entity that were caused by using free to deallocate memory blocks that were allocated by xmalloc (via xstrdup). --- diff --git a/src/ChangeLog b/src/ChangeLog index a088c1b42d0..764b345bd25 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,13 @@ +2011-04-16 Ben Key + + * nsfont.m: Fixed bugs in ns_get_family and + ns_descriptor_to_entity that were caused by using free to + deallocate memory blocks that were allocated by xmalloc (via + xstrdup). This caused Emacs to crash when compiled with + XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with + --enable-checking=xmallocoverrun). xfree is now used to + deallocate these memory blocks. + 2011-04-15 Paul Eggert * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT. diff --git a/src/nsfont.m b/src/nsfont.m index 48d40223553..76c70aadf9f 100644 --- a/src/nsfont.m +++ b/src/nsfont.m @@ -104,7 +104,7 @@ ns_get_family (Lisp_Object font_spec) NSString *family; ns_unescape_name (tmp); family = [NSString stringWithUTF8String: tmp]; - free (tmp); + xfree (tmp); return family; } } @@ -217,7 +217,7 @@ ns_descriptor_to_entity (NSFontDescriptor *desc, debug_print (font_entity); } - free (escapedFamily); + xfree (escapedFamily); return font_entity; }