diff options
| author | Andreas Schwab | 2011-04-12 12:20:32 +0200 |
|---|---|---|
| committer | Andreas Schwab | 2011-04-12 12:20:32 +0200 |
| commit | baad03f0e1fe3bf27d52a425e0e374af6d1cf407 (patch) | |
| tree | e86f0c3b393c801dd2f77c3fdadff8eb789712b1 /src | |
| parent | e7974947bc66f311e3883bb19aec11f3fe4dc7f6 (diff) | |
| download | emacs-baad03f0e1fe3bf27d52a425e0e374af6d1cf407.tar.gz emacs-baad03f0e1fe3bf27d52a425e0e374af6d1cf407.zip | |
Use xfree instead of free where appropriate (Bug#8437)
* charset.c (Fclear_charset_maps): Use xfree instead of free.
(Bug#8437)
* keyboard.c (parse_tool_bar_item): Likewise.
* sound.c (sound_cleanup, alsa_close): Likewise.
* termcap.c (tgetent): Likewise.
* xfns.c (x_default_font_parameter): Likewise.
* xsettings.c (read_and_apply_settings): Likewise.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 8 | ||||
| -rw-r--r-- | src/charset.c | 2 | ||||
| -rw-r--r-- | src/keyboard.c | 2 | ||||
| -rw-r--r-- | src/sound.c | 6 | ||||
| -rw-r--r-- | src/termcap.c | 10 | ||||
| -rw-r--r-- | src/xfns.c | 2 | ||||
| -rw-r--r-- | src/xsettings.c | 6 |
7 files changed, 22 insertions, 14 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index b1e17766f37..211625ee446 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,13 @@ | |||
| 1 | 2011-04-12 Andreas Schwab <schwab@linux-m68k.org> | 1 | 2011-04-12 Andreas Schwab <schwab@linux-m68k.org> |
| 2 | 2 | ||
| 3 | * charset.c (Fclear_charset_maps): Use xfree instead of free. | ||
| 4 | (Bug#8437) | ||
| 5 | * keyboard.c (parse_tool_bar_item): Likewise. | ||
| 6 | * sound.c (sound_cleanup, alsa_close): Likewise. | ||
| 7 | * termcap.c (tgetent): Likewise. | ||
| 8 | * xfns.c (x_default_font_parameter): Likewise. | ||
| 9 | * xsettings.c (read_and_apply_settings): Likewise. | ||
| 10 | |||
| 3 | * alloc.c (overrun_check_malloc, overrun_check_realloc) | 11 | * alloc.c (overrun_check_malloc, overrun_check_realloc) |
| 4 | (overrun_check_free): Protoize. | 12 | (overrun_check_free): Protoize. |
| 5 | 13 | ||
diff --git a/src/charset.c b/src/charset.c index 00206cccf0b..783d7db5733 100644 --- a/src/charset.c +++ b/src/charset.c | |||
| @@ -2145,7 +2145,7 @@ It should be called only from temacs invoked for dumping. */) | |||
| 2145 | { | 2145 | { |
| 2146 | if (temp_charset_work) | 2146 | if (temp_charset_work) |
| 2147 | { | 2147 | { |
| 2148 | free (temp_charset_work); | 2148 | xfree (temp_charset_work); |
| 2149 | temp_charset_work = NULL; | 2149 | temp_charset_work = NULL; |
| 2150 | } | 2150 | } |
| 2151 | 2151 | ||
diff --git a/src/keyboard.c b/src/keyboard.c index 5df4f1b1ff4..a73f6656cd2 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -8253,7 +8253,7 @@ parse_tool_bar_item (Lisp_Object key, Lisp_Object item) | |||
| 8253 | PROP (TOOL_BAR_ITEM_LABEL) = new_lbl; | 8253 | PROP (TOOL_BAR_ITEM_LABEL) = new_lbl; |
| 8254 | else | 8254 | else |
| 8255 | PROP (TOOL_BAR_ITEM_LABEL) = make_string ("", 0); | 8255 | PROP (TOOL_BAR_ITEM_LABEL) = make_string ("", 0); |
| 8256 | free (buf); | 8256 | xfree (buf); |
| 8257 | } | 8257 | } |
| 8258 | 8258 | ||
| 8259 | /* If got a filter apply it on binding. */ | 8259 | /* If got a filter apply it on binding. */ |
diff --git a/src/sound.c b/src/sound.c index a9bd540aaa9..7d7317e71b3 100644 --- a/src/sound.c +++ b/src/sound.c | |||
| @@ -460,8 +460,8 @@ sound_cleanup (Lisp_Object arg) | |||
| 460 | current_sound_device->close (current_sound_device); | 460 | current_sound_device->close (current_sound_device); |
| 461 | if (current_sound->fd > 0) | 461 | if (current_sound->fd > 0) |
| 462 | emacs_close (current_sound->fd); | 462 | emacs_close (current_sound->fd); |
| 463 | free (current_sound_device); | 463 | xfree (current_sound_device); |
| 464 | free (current_sound); | 464 | xfree (current_sound); |
| 465 | 465 | ||
| 466 | return Qnil; | 466 | return Qnil; |
| 467 | } | 467 | } |
| @@ -1095,7 +1095,7 @@ alsa_close (struct sound_device *sd) | |||
| 1095 | snd_pcm_drain (p->handle); | 1095 | snd_pcm_drain (p->handle); |
| 1096 | snd_pcm_close (p->handle); | 1096 | snd_pcm_close (p->handle); |
| 1097 | } | 1097 | } |
| 1098 | free (p); | 1098 | xfree (p); |
| 1099 | } | 1099 | } |
| 1100 | } | 1100 | } |
| 1101 | 1101 | ||
diff --git a/src/termcap.c b/src/termcap.c index 27a20a67ae1..5b71ad229d7 100644 --- a/src/termcap.c +++ b/src/termcap.c | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* Work-alike for termcap, plus extra features. | 1 | /* Work-alike for termcap, plus extra features. |
| 2 | Copyright (C) 1985, 1986, 1993, 1994, 1995, 2000, 2001, 2002, 2003, | 2 | Copyright (C) 1985, 1986, 1993, 1994, 1995, 2000, 2001, 2002, 2003, |
| 3 | 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. | 3 | 2004, 2005, 2006, 2007, 2008, 2011 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
| 6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
| @@ -468,15 +468,15 @@ tgetent (char *bp, const char *name) | |||
| 468 | if (scan_file (term, fd, &buf) == 0) | 468 | if (scan_file (term, fd, &buf) == 0) |
| 469 | { | 469 | { |
| 470 | close (fd); | 470 | close (fd); |
| 471 | free (buf.beg); | 471 | xfree (buf.beg); |
| 472 | if (malloc_size) | 472 | if (malloc_size) |
| 473 | free (bp); | 473 | xfree (bp); |
| 474 | return 0; | 474 | return 0; |
| 475 | } | 475 | } |
| 476 | 476 | ||
| 477 | /* Free old `term' if appropriate. */ | 477 | /* Free old `term' if appropriate. */ |
| 478 | if (term != name) | 478 | if (term != name) |
| 479 | free (term); | 479 | xfree (term); |
| 480 | 480 | ||
| 481 | /* If BP is malloc'd by us, make sure it is big enough. */ | 481 | /* If BP is malloc'd by us, make sure it is big enough. */ |
| 482 | if (malloc_size) | 482 | if (malloc_size) |
| @@ -506,7 +506,7 @@ tgetent (char *bp, const char *name) | |||
| 506 | } | 506 | } |
| 507 | 507 | ||
| 508 | close (fd); | 508 | close (fd); |
| 509 | free (buf.beg); | 509 | xfree (buf.beg); |
| 510 | 510 | ||
| 511 | if (malloc_size) | 511 | if (malloc_size) |
| 512 | bp = (char *) xrealloc (bp, bp1 - bp + 1); | 512 | bp = (char *) xrealloc (bp, bp1 - bp + 1); |
diff --git a/src/xfns.c b/src/xfns.c index 04b8e44b561..33b21c84b2c 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -2983,7 +2983,7 @@ x_default_font_parameter (struct frame *f, Lisp_Object parms) | |||
| 2983 | { | 2983 | { |
| 2984 | char *name = xstrdup (system_font); | 2984 | char *name = xstrdup (system_font); |
| 2985 | font = font_open_by_name (f, name); | 2985 | font = font_open_by_name (f, name); |
| 2986 | free (name); | 2986 | xfree (name); |
| 2987 | } | 2987 | } |
| 2988 | } | 2988 | } |
| 2989 | 2989 | ||
diff --git a/src/xsettings.c b/src/xsettings.c index 097b2477e03..24ea48e7b67 100644 --- a/src/xsettings.c +++ b/src/xsettings.c | |||
| @@ -566,20 +566,20 @@ read_and_apply_settings (struct x_display_info *dpyinfo, int send_event_p) | |||
| 566 | if (send_event_p) | 566 | if (send_event_p) |
| 567 | store_config_changed_event (Qtool_bar_style, dpyname); | 567 | store_config_changed_event (Qtool_bar_style, dpyname); |
| 568 | } | 568 | } |
| 569 | free (settings.tb_style); | 569 | xfree (settings.tb_style); |
| 570 | } | 570 | } |
| 571 | 571 | ||
| 572 | if (settings.seen & SEEN_FONT) | 572 | if (settings.seen & SEEN_FONT) |
| 573 | { | 573 | { |
| 574 | if (!current_font || strcmp (current_font, settings.font) != 0) | 574 | if (!current_font || strcmp (current_font, settings.font) != 0) |
| 575 | { | 575 | { |
| 576 | free (current_font); | 576 | xfree (current_font); |
| 577 | current_font = settings.font; | 577 | current_font = settings.font; |
| 578 | if (send_event_p) | 578 | if (send_event_p) |
| 579 | store_config_changed_event (Qfont_name, dpyname); | 579 | store_config_changed_event (Qfont_name, dpyname); |
| 580 | } | 580 | } |
| 581 | else | 581 | else |
| 582 | free (settings.font); | 582 | xfree (settings.font); |
| 583 | } | 583 | } |
| 584 | } | 584 | } |
| 585 | 585 | ||