Commit baad03f0 authored by Andreas Schwab's avatar Andreas Schwab
Browse files

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.
parent e7974947
2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
* 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.
* alloc.c (overrun_check_malloc, overrun_check_realloc)
(overrun_check_free): Protoize.
......
......@@ -2145,7 +2145,7 @@ It should be called only from temacs invoked for dumping. */)
{
if (temp_charset_work)
{
free (temp_charset_work);
xfree (temp_charset_work);
temp_charset_work = NULL;
}
......
......@@ -8253,7 +8253,7 @@ parse_tool_bar_item (Lisp_Object key, Lisp_Object item)
PROP (TOOL_BAR_ITEM_LABEL) = new_lbl;
else
PROP (TOOL_BAR_ITEM_LABEL) = make_string ("", 0);
free (buf);
xfree (buf);
}
/* If got a filter apply it on binding. */
......
......@@ -460,8 +460,8 @@ sound_cleanup (Lisp_Object arg)
current_sound_device->close (current_sound_device);
if (current_sound->fd > 0)
emacs_close (current_sound->fd);
free (current_sound_device);
free (current_sound);
xfree (current_sound_device);
xfree (current_sound);
return Qnil;
}
......@@ -1095,7 +1095,7 @@ alsa_close (struct sound_device *sd)
snd_pcm_drain (p->handle);
snd_pcm_close (p->handle);
}
free (p);
xfree (p);
}
}
......
/* Work-alike for termcap, plus extra features.
Copyright (C) 1985, 1986, 1993, 1994, 1995, 2000, 2001, 2002, 2003,
2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
2004, 2005, 2006, 2007, 2008, 2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -468,15 +468,15 @@ tgetent (char *bp, const char *name)
if (scan_file (term, fd, &buf) == 0)
{
close (fd);
free (buf.beg);
xfree (buf.beg);
if (malloc_size)
free (bp);
xfree (bp);
return 0;
}
/* Free old `term' if appropriate. */
if (term != name)
free (term);
xfree (term);
/* If BP is malloc'd by us, make sure it is big enough. */
if (malloc_size)
......@@ -506,7 +506,7 @@ tgetent (char *bp, const char *name)
}
close (fd);
free (buf.beg);
xfree (buf.beg);
if (malloc_size)
bp = (char *) xrealloc (bp, bp1 - bp + 1);
......
......@@ -2983,7 +2983,7 @@ x_default_font_parameter (struct frame *f, Lisp_Object parms)
{
char *name = xstrdup (system_font);
font = font_open_by_name (f, name);
free (name);
xfree (name);
}
}
......
......@@ -566,20 +566,20 @@ read_and_apply_settings (struct x_display_info *dpyinfo, int send_event_p)
if (send_event_p)
store_config_changed_event (Qtool_bar_style, dpyname);
}
free (settings.tb_style);
xfree (settings.tb_style);
}
if (settings.seen & SEEN_FONT)
{
if (!current_font || strcmp (current_font, settings.font) != 0)
{
free (current_font);
xfree (current_font);
current_font = settings.font;
if (send_event_p)
store_config_changed_event (Qfont_name, dpyname);
}
else
free (settings.font);
xfree (settings.font);
}
}
......
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