aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBen Key2011-04-15 22:14:08 -0500
committerBen Key2011-04-15 22:14:08 -0500
commit613052cdfe876e3e51b02c3fc72d04f3da63305b (patch)
tree1595a7bf088edf64491c4556264ba784d4dd3521 /src
parent4a1a6b5b7d2208cf504cf38e548d3c562f6cfbb3 (diff)
downloademacs-613052cdfe876e3e51b02c3fc72d04f3da63305b.tar.gz
emacs-613052cdfe876e3e51b02c3fc72d04f3da63305b.zip
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).
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog10
-rw-r--r--src/nsfont.m4
2 files changed, 12 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index a088c1b42d0..764b345bd25 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,13 @@
12011-04-16 Ben Key <bkey76@gmail.com>
2
3 * nsfont.m: Fixed bugs in ns_get_family and
4 ns_descriptor_to_entity that were caused by using free to
5 deallocate memory blocks that were allocated by xmalloc (via
6 xstrdup). This caused Emacs to crash when compiled with
7 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
8 --enable-checking=xmallocoverrun). xfree is now used to
9 deallocate these memory blocks.
10
12011-04-15 Paul Eggert <eggert@cs.ucla.edu> 112011-04-15 Paul Eggert <eggert@cs.ucla.edu>
2 12
3 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT. 13 * 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)
104 NSString *family; 104 NSString *family;
105 ns_unescape_name (tmp); 105 ns_unescape_name (tmp);
106 family = [NSString stringWithUTF8String: tmp]; 106 family = [NSString stringWithUTF8String: tmp];
107 free (tmp); 107 xfree (tmp);
108 return family; 108 return family;
109 } 109 }
110} 110}
@@ -217,7 +217,7 @@ ns_descriptor_to_entity (NSFontDescriptor *desc,
217 debug_print (font_entity); 217 debug_print (font_entity);
218 } 218 }
219 219
220 free (escapedFamily); 220 xfree (escapedFamily);
221 return font_entity; 221 return font_entity;
222} 222}
223 223