aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJim Meyering2008-06-02 06:09:17 +0000
committerJim Meyering2008-06-02 06:09:17 +0000
commit70fdbb46cd40f9376333e10c9284873d3a3a787f (patch)
treed087a93bc6d9be911fce5e28e1112f6c5dfddb09 /src
parent5c19cd0bbb8f3b8142c0b8f90eebdd84b7a3eb29 (diff)
downloademacs-70fdbb46cd40f9376333e10c9284873d3a3a787f.tar.gz
emacs-70fdbb46cd40f9376333e10c9284873d3a3a787f.zip
Make "xfree (NULL)" a no-op; remove useless if-before-xfree.
* src/alloc.c (xfree): Return right away for a NULL arg. * src/lread.c (nosuffix): Remove now-useless if-before-xfree tests. * src/gtkutil.c (xg_gtk_scroll_destroy): Likewise. * src/mac.c (create_apple_event_from_event_ref): Likewise. (create_apple_event_from_drag_ref, cfstring_create_normalized): Likewise. * src/doprnt.c (doprnt1): Likewise. * src/frame.c (frame): Likewise. * src/keyboard.c (wipe_kboard): Likewise. * src/macterm.c (x_free_frame_resources, xlfdpat_destroy, XFreePixmap): (init_font_name_table, mac_unload_font, x_delete_display): Likewise. * src/term.c (tty_default_color_capabilities, maybe_fatal) (delete_tty): Likewise. * src/w16select.c (string): Likewise. * src/w32.c (w32_get_resource, SET_ENV_BUF_SIZE): Likewise. * src/w32bdf.c (w32_free_bdf_font): Likewise. * src/w32fns.c (w32_unload_font): Likewise. * src/w32font.c (w32font_close): Likewise. * src/window.c (size_window): Likewise. * src/xselect.c (receive_incremental_selection): Likewise. * src/xterm.c (x_free_frame_resources, x_delete_display): Likewise. * src/mactoolbox.c (create_apple_event_from_drag_ref): Likewise. * src/w32.c (stat): Likewise.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog38
-rw-r--r--src/alloc.c2
-rw-r--r--src/doprnt.c3
-rw-r--r--src/frame.c21
-rw-r--r--src/gtkutil.c2
-rw-r--r--src/keyboard.c3
-rw-r--r--src/lread.c3
-rw-r--r--src/mac.c9
-rw-r--r--src/macterm.c27
-rw-r--r--src/mactoolbox.c3
-rw-r--r--src/term.c26
-rw-r--r--src/w16select.c3
-rw-r--r--src/w32.c9
-rw-r--r--src/w32bdf.c8
-rw-r--r--src/w32fns.c2
-rw-r--r--src/window.c2
-rw-r--r--src/xselect.c2
-rw-r--r--src/xterm.c10
18 files changed, 80 insertions, 93 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 5d071f0c764..d7db9c29588 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,13 +1,37 @@
12008-06-02 Jim Meyering <meyering@redhat.com> 12008-06-02 Jim Meyering <meyering@redhat.com>
2 2
3 Make "xfree (NULL)" a no-op; remove useless if-before-xfree.
4 * alloc.c (xfree): Return right away for a NULL arg.
5 * lread.c (nosuffix): Remove now-useless if-before-xfree tests.
6 * gtkutil.c (xg_gtk_scroll_destroy): Likewise.
7 * mac.c (create_apple_event_from_event_ref): Likewise.
8 (create_apple_event_from_drag_ref, cfstring_create_normalized): Likewise.
9 * doprnt.c (doprnt1): Likewise.
10 * frame.c (frame): Likewise.
11 * keyboard.c (wipe_kboard): Likewise.
12 * macterm.c (x_free_frame_resources, xlfdpat_destroy, XFreePixmap):
13 (init_font_name_table, mac_unload_font, x_delete_display): Likewise.
14 * term.c (tty_default_color_capabilities, maybe_fatal)
15 (delete_tty): Likewise.
16 * w16select.c (string): Likewise.
17 * w32.c (w32_get_resource, SET_ENV_BUF_SIZE): Likewise.
18 * w32bdf.c (w32_free_bdf_font): Likewise.
19 * w32fns.c (w32_unload_font): Likewise.
20 * w32font.c (w32font_close): Likewise.
21 * window.c (size_window): Likewise.
22 * xselect.c (receive_incremental_selection): Likewise.
23 * xterm.c (x_free_frame_resources, x_delete_display): Likewise.
24 * mactoolbox.c (create_apple_event_from_drag_ref): Likewise.
25 * w32.c (stat): Likewise.
26
3 remove useless if-before-free tests 27 remove useless if-before-free tests
4 * src/editfns.c (Fset_time_zone_rule): Likewise. 28 * editfns.c (Fset_time_zone_rule): Likewise.
5 * src/lread.c (nosuffix): Likewise. 29 * lread.c (nosuffix): Likewise.
6 * src/ralloc.c (get_bloc): Likewise. 30 * ralloc.c (get_bloc): Likewise.
7 * src/regex.c (reg_free): Likewise. 31 * regex.c (reg_free): Likewise.
8 * src/xftfont.c (xftfont_open, xftfont_close): Likewise. 32 * xftfont.c (xftfont_open, xftfont_close): Likewise.
9 * src/xrdb.c (get_user_app, get_environ_db, x_load_resources): Likewise. 33 * xrdb.c (get_user_app, get_environ_db, x_load_resources): Likewise.
10 * src/xsmfns.c (smc_save_yourself_CB): Likewise. 34 * xsmfns.c (smc_save_yourself_CB): Likewise.
11 35
122008-06-02 Kenichi Handa <handa@m17n.org> 362008-06-02 Kenichi Handa <handa@m17n.org>
13 37
diff --git a/src/alloc.c b/src/alloc.c
index 031cb99b674..797b385fbd2 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -797,6 +797,8 @@ void
797xfree (block) 797xfree (block)
798 POINTER_TYPE *block; 798 POINTER_TYPE *block;
799{ 799{
800 if (!block)
801 return;
800 MALLOC_BLOCK_INPUT; 802 MALLOC_BLOCK_INPUT;
801 free (block); 803 free (block);
802 MALLOC_UNBLOCK_INPUT; 804 MALLOC_UNBLOCK_INPUT;
diff --git a/src/doprnt.c b/src/doprnt.c
index 05b194c9dbb..c7c27bac4c3 100644
--- a/src/doprnt.c
+++ b/src/doprnt.c
@@ -326,8 +326,7 @@ doprnt1 (lispstrings, buffer, bufsize, format, format_end, nargs, args)
326 }; 326 };
327 327
328 /* If we had to malloc something, free it. */ 328 /* If we had to malloc something, free it. */
329 if (big_buffer) 329 xfree (big_buffer);
330 xfree (big_buffer);
331 330
332 *bufptr = 0; /* Make sure our string end with a '\0' */ 331 *bufptr = 0; /* Make sure our string end with a '\0' */
333 return bufptr - buffer; 332 return bufptr - buffer;
diff --git a/src/frame.c b/src/frame.c
index 20812878c10..84a4e54d314 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -1477,20 +1477,13 @@ But FORCE inhibits this too. */)
1477 Vframe_list = Fdelq (frame, Vframe_list); 1477 Vframe_list = Fdelq (frame, Vframe_list);
1478 FRAME_SET_VISIBLE (f, 0); 1478 FRAME_SET_VISIBLE (f, 0);
1479 1479
1480 if (f->namebuf) 1480 xfree (f->namebuf);
1481 xfree (f->namebuf); 1481 xfree (f->decode_mode_spec_buffer);
1482 if (f->decode_mode_spec_buffer) 1482 xfree (FRAME_INSERT_COST (f));
1483 xfree (f->decode_mode_spec_buffer); 1483 xfree (FRAME_DELETEN_COST (f));
1484 if (FRAME_INSERT_COST (f)) 1484 xfree (FRAME_INSERTN_COST (f));
1485 xfree (FRAME_INSERT_COST (f)); 1485 xfree (FRAME_DELETE_COST (f));
1486 if (FRAME_DELETEN_COST (f)) 1486 xfree (FRAME_MESSAGE_BUF (f));
1487 xfree (FRAME_DELETEN_COST (f));
1488 if (FRAME_INSERTN_COST (f))
1489 xfree (FRAME_INSERTN_COST (f));
1490 if (FRAME_DELETE_COST (f))
1491 xfree (FRAME_DELETE_COST (f));
1492 if (FRAME_MESSAGE_BUF (f))
1493 xfree (FRAME_MESSAGE_BUF (f));
1494 1487
1495 /* Since some events are handled at the interrupt level, we may get 1488 /* Since some events are handled at the interrupt level, we may get
1496 an event for f at any time; if we zero out the frame's terminal 1489 an event for f at any time; if we zero out the frame's terminal
diff --git a/src/gtkutil.c b/src/gtkutil.c
index fd0fbf778b2..afafee11916 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -3106,7 +3106,7 @@ xg_gtk_scroll_destroy (widget, data)
3106 int id = (int) (EMACS_INT) data; /* The EMACS_INT cast avoids a warning. */ 3106 int id = (int) (EMACS_INT) data; /* The EMACS_INT cast avoids a warning. */
3107 3107
3108 p = g_object_get_data (G_OBJECT (widget), XG_LAST_SB_DATA); 3108 p = g_object_get_data (G_OBJECT (widget), XG_LAST_SB_DATA);
3109 if (p) xfree (p); 3109 xfree (p);
3110 xg_remove_widget_from_map (id); 3110 xg_remove_widget_from_map (id);
3111} 3111}
3112 3112
diff --git a/src/keyboard.c b/src/keyboard.c
index 45f3d2f6194..5ac28a55247 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -11575,8 +11575,7 @@ static void
11575wipe_kboard (kb) 11575wipe_kboard (kb)
11576 KBOARD *kb; 11576 KBOARD *kb;
11577{ 11577{
11578 if (kb->kbd_macro_buffer) 11578 xfree (kb->kbd_macro_buffer);
11579 xfree (kb->kbd_macro_buffer);
11580} 11579}
11581 11580
11582#ifdef MULTI_KBOARD 11581#ifdef MULTI_KBOARD
diff --git a/src/lread.c b/src/lread.c
index 578addf1329..e5e77bc3477 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -1273,8 +1273,7 @@ Return t if the file exists and loads successfully. */)
1273 saved_doc_string = 0; 1273 saved_doc_string = 0;
1274 saved_doc_string_size = 0; 1274 saved_doc_string_size = 0;
1275 1275
1276 if (prev_saved_doc_string) 1276 xfree (prev_saved_doc_string);
1277 xfree (prev_saved_doc_string);
1278 prev_saved_doc_string = 0; 1277 prev_saved_doc_string = 0;
1279 prev_saved_doc_string_size = 0; 1278 prev_saved_doc_string_size = 0;
1280 1279
diff --git a/src/mac.c b/src/mac.c
index e549524bc1f..20872b2bdc9 100644
--- a/src/mac.c
+++ b/src/mac.c
@@ -906,8 +906,7 @@ mac_event_parameters_to_lisp (event, num_params, names, types)
906 break; 906 break;
907 } 907 }
908 } 908 }
909 if (buf) 909 xfree (buf);
910 xfree (buf);
911 910
912 return result; 911 return result;
913} 912}
@@ -4778,10 +4777,8 @@ cfstring_create_normalized (str, symbol)
4778 out_len / sizeof (UniChar)); 4777 out_len / sizeof (UniChar));
4779 if (uni) 4778 if (uni)
4780 DisposeUnicodeToTextInfo (&uni); 4779 DisposeUnicodeToTextInfo (&uni);
4781 if (out_buf) 4780 xfree (out_buf);
4782 xfree (out_buf); 4781 xfree (buffer);
4783 if (buffer)
4784 xfree (buffer);
4785 } 4782 }
4786 else 4783 else
4787 { 4784 {
diff --git a/src/macterm.c b/src/macterm.c
index ae9aa1108d2..2871bfa1179 100644
--- a/src/macterm.c
+++ b/src/macterm.c
@@ -910,8 +910,7 @@ XFreePixmap (display, pixmap)
910#if USE_MAC_IMAGE_IO 910#if USE_MAC_IMAGE_IO
911 if (pixmap) 911 if (pixmap)
912 { 912 {
913 if (pixmap->data) 913 xfree (pixmap->data);
914 xfree (pixmap->data);
915 xfree (pixmap); 914 xfree (pixmap);
916 } 915 }
917#else 916#else
@@ -7390,8 +7389,7 @@ x_free_frame_resources (f)
7390 7389
7391 x_free_gcs (f); 7390 x_free_gcs (f);
7392 7391
7393 if (FRAME_SIZE_HINTS (f)) 7392 xfree (FRAME_SIZE_HINTS (f));
7394 xfree (FRAME_SIZE_HINTS (f));
7395 7393
7396 xfree (f->output_data.mac); 7394 xfree (f->output_data.mac);
7397 f->output_data.mac = NULL; 7395 f->output_data.mac = NULL;
@@ -7640,8 +7638,7 @@ xlfdpat_destroy (pat)
7640 { 7638 {
7641 if (pat->buf) 7639 if (pat->buf)
7642 { 7640 {
7643 if (pat->blocks) 7641 xfree (pat->blocks);
7644 xfree (pat->blocks);
7645 xfree (pat->buf); 7642 xfree (pat->buf);
7646 } 7643 }
7647 xfree (pat); 7644 xfree (pat);
@@ -8364,8 +8361,7 @@ init_font_name_table ()
8364 HASH_VALUE (h, j)); 8361 HASH_VALUE (h, j));
8365 prev_family = family; 8362 prev_family = family;
8366 } 8363 }
8367 if (font_ids) 8364 xfree (font_ids);
8368 xfree (font_ids);
8369 } 8365 }
8370#endif 8366#endif
8371 8367
@@ -9242,20 +9238,17 @@ mac_unload_font (dpyinfo, font)
9242 int i; 9238 int i;
9243 9239
9244 for (i = font->min_byte1; i <= font->max_byte1; i++) 9240 for (i = font->min_byte1; i <= font->max_byte1; i++)
9245 if (font->bounds.rows[i]) 9241 xfree (font->bounds.rows[i]);
9246 xfree (font->bounds.rows[i]);
9247 xfree (font->bounds.rows); 9242 xfree (font->bounds.rows);
9248 ATSUDisposeStyle (font->mac_style); 9243 ATSUDisposeStyle (font->mac_style);
9249 } 9244 }
9250 else 9245 else
9251#endif 9246#endif
9252 if (font->bounds.per_char) 9247 xfree (font->bounds.per_char);
9253 xfree (font->bounds.per_char);
9254#if USE_CG_TEXT_DRAWING 9248#if USE_CG_TEXT_DRAWING
9255 if (font->cg_font) 9249 if (font->cg_font)
9256 CGFontRelease (font->cg_font); 9250 CGFontRelease (font->cg_font);
9257 if (font->cg_glyphs) 9251 xfree (font->cg_glyphs);
9258 xfree (font->cg_glyphs);
9259#endif 9252#endif
9260 xfree (font); 9253 xfree (font);
9261} 9254}
@@ -13026,12 +13019,10 @@ x_delete_display (dpyinfo)
13026 13019
13027 if (dpyinfo->font_table) 13020 if (dpyinfo->font_table)
13028 { 13021 {
13029 if (dpyinfo->font_table->font_encoder) 13022 xfree (dpyinfo->font_table->font_encoder);
13030 xfree (dpyinfo->font_table->font_encoder);
13031 xfree (dpyinfo->font_table); 13023 xfree (dpyinfo->font_table);
13032 } 13024 }
13033 if (dpyinfo->mac_id_name) 13025 xfree (dpyinfo->mac_id_name);
13034 xfree (dpyinfo->mac_id_name);
13035 13026
13036 if (x_display_list == 0) 13027 if (x_display_list == 0)
13037 { 13028 {
diff --git a/src/mactoolbox.c b/src/mactoolbox.c
index b5e87a3c672..a73578d5205 100644
--- a/src/mactoolbox.c
+++ b/src/mactoolbox.c
@@ -6091,8 +6091,7 @@ create_apple_event_from_drag_ref (drag, num_types, types, result)
6091 if (err != noErr) 6091 if (err != noErr)
6092 break; 6092 break;
6093 } 6093 }
6094 if (buf) 6094 xfree (buf);
6095 xfree (buf);
6096 6095
6097 if (err == noErr) 6096 if (err == noErr)
6098 { 6097 {
diff --git a/src/term.c b/src/term.c
index 7636f22db75..533104dc040 100644
--- a/src/term.c
+++ b/src/term.c
@@ -2090,17 +2090,14 @@ tty_default_color_capabilities (struct tty_display_info *tty, int save)
2090 2090
2091 if (save) 2091 if (save)
2092 { 2092 {
2093 if (default_orig_pair) 2093 xfree (default_orig_pair);
2094 xfree (default_orig_pair);
2095 default_orig_pair = tty->TS_orig_pair ? xstrdup (tty->TS_orig_pair) : NULL; 2094 default_orig_pair = tty->TS_orig_pair ? xstrdup (tty->TS_orig_pair) : NULL;
2096 2095
2097 if (default_set_foreground) 2096 xfree (default_set_foreground);
2098 xfree (default_set_foreground);
2099 default_set_foreground = tty->TS_set_foreground ? xstrdup (tty->TS_set_foreground) 2097 default_set_foreground = tty->TS_set_foreground ? xstrdup (tty->TS_set_foreground)
2100 : NULL; 2098 : NULL;
2101 2099
2102 if (default_set_background) 2100 xfree (default_set_background);
2103 xfree (default_set_background);
2104 default_set_background = tty->TS_set_background ? xstrdup (tty->TS_set_background) 2101 default_set_background = tty->TS_set_background ? xstrdup (tty->TS_set_background)
2105 : NULL; 2102 : NULL;
2106 2103
@@ -3833,8 +3830,7 @@ maybe_fatal (must_succeed, buffer, terminal, str1, str2, arg1, arg2)
3833 struct terminal *terminal; 3830 struct terminal *terminal;
3834 char *str1, *str2, *arg1, *arg2; 3831 char *str1, *str2, *arg1, *arg2;
3835{ 3832{
3836 if (buffer) 3833 xfree (buffer);
3837 xfree (buffer);
3838 3834
3839 if (terminal) 3835 if (terminal)
3840 delete_tty (terminal); 3836 delete_tty (terminal);
@@ -3915,11 +3911,8 @@ delete_tty (struct terminal *terminal)
3915 3911
3916 delete_terminal (terminal); 3912 delete_terminal (terminal);
3917 3913
3918 if (tty->name) 3914 xfree (tty->name);
3919 xfree (tty->name); 3915 xfree (tty->type);
3920
3921 if (tty->type)
3922 xfree (tty->type);
3923 3916
3924 if (tty->input) 3917 if (tty->input)
3925 { 3918 {
@@ -3932,11 +3925,8 @@ delete_tty (struct terminal *terminal)
3932 if (tty->termscript) 3925 if (tty->termscript)
3933 fclose (tty->termscript); 3926 fclose (tty->termscript);
3934 3927
3935 if (tty->old_tty) 3928 xfree (tty->old_tty);
3936 xfree (tty->old_tty); 3929 xfree (tty->Wcm);
3937
3938 if (tty->Wcm)
3939 xfree (tty->Wcm);
3940 3930
3941 bzero (tty, sizeof (struct tty_display_info)); 3931 bzero (tty, sizeof (struct tty_display_info));
3942 xfree (tty); 3932 xfree (tty);
diff --git a/src/w16select.c b/src/w16select.c
index 24e92b24dfb..177a84f5e3b 100644
--- a/src/w16select.c
+++ b/src/w16select.c
@@ -565,8 +565,7 @@ DEFUN ("w16-set-clipboard-data", Fw16_set_clipboard_data, Sw16_set_clipboard_dat
565 ok = 0; 565 ok = 0;
566 566
567 unblock: 567 unblock:
568 if (dst) 568 xfree (dst);
569 xfree (dst);
570 UNBLOCK_INPUT; 569 UNBLOCK_INPUT;
571 570
572 /* Notify user if the text is too large to fit into DOS memory. 571 /* Notify user if the text is too large to fit into DOS memory.
diff --git a/src/w32.c b/src/w32.c
index 36635a433f5..81accb6b610 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -1128,7 +1128,7 @@ w32_get_resource (key, lpdwtype)
1128 return (lpvalue); 1128 return (lpvalue);
1129 } 1129 }
1130 1130
1131 if (lpvalue) xfree (lpvalue); 1131 xfree (lpvalue);
1132 1132
1133 RegCloseKey (hrootkey); 1133 RegCloseKey (hrootkey);
1134 } 1134 }
@@ -1145,7 +1145,7 @@ w32_get_resource (key, lpdwtype)
1145 return (lpvalue); 1145 return (lpvalue);
1146 } 1146 }
1147 1147
1148 if (lpvalue) xfree (lpvalue); 1148 xfree (lpvalue);
1149 1149
1150 RegCloseKey (hrootkey); 1150 RegCloseKey (hrootkey);
1151 } 1151 }
@@ -1346,7 +1346,7 @@ init_environment (char ** argv)
1346 /* Also ignore empty environment variables. */ 1346 /* Also ignore empty environment variables. */
1347 || *lpval == 0) 1347 || *lpval == 0)
1348 { 1348 {
1349 if (lpval) xfree (lpval); 1349 xfree (lpval);
1350 lpval = env_vars[i].def_value; 1350 lpval = env_vars[i].def_value;
1351 dwType = REG_EXPAND_SZ; 1351 dwType = REG_EXPAND_SZ;
1352 dont_free = 1; 1352 dont_free = 1;
@@ -2962,8 +2962,7 @@ stat (const char * path, struct stat * buf)
2962 2962
2963 get_file_owner_and_group (NULL, name, buf); 2963 get_file_owner_and_group (NULL, name, buf);
2964 } 2964 }
2965 if (psd) 2965 xfree (psd);
2966 xfree (psd);
2967 2966
2968#if 0 2967#if 0
2969 /* Not sure if there is any point in this. */ 2968 /* Not sure if there is any point in this. */
diff --git a/src/w32bdf.c b/src/w32bdf.c
index e7fbe51b146..e9a1e63569e 100644
--- a/src/w32bdf.c
+++ b/src/w32bdf.c
@@ -304,10 +304,10 @@ w32_free_bdf_font(bdffont *fontp)
304 CloseHandle(fontp->hfilemap); 304 CloseHandle(fontp->hfilemap);
305 CloseHandle(fontp->hfile); 305 CloseHandle(fontp->hfile);
306 306
307 if (fontp->registry) xfree(fontp->registry); 307 xfree(fontp->registry);
308 if (fontp->encoding) xfree(fontp->encoding); 308 xfree(fontp->encoding);
309 if (fontp->slant) xfree(fontp->slant); 309 xfree(fontp->slant);
310/* if (fontp->width) xfree(fontp->width); */ 310/* xfree(fontp->width); */
311 311
312 xfree(fontp->filename); 312 xfree(fontp->filename);
313 for(i = 0;i < BDF_FIRST_OFFSET_TABLE;i++) 313 for(i = 0;i < BDF_FIRST_OFFSET_TABLE;i++)
diff --git a/src/w32fns.c b/src/w32fns.c
index b18a1233b8a..e83acf0711d 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -4955,7 +4955,7 @@ w32_unload_font (dpyinfo, font)
4955{ 4955{
4956 if (font) 4956 if (font)
4957 { 4957 {
4958 if (font->per_char) xfree (font->per_char); 4958 xfree (font->per_char);
4959 if (font->bdf) w32_free_bdf_font (font->bdf); 4959 if (font->bdf) w32_free_bdf_font (font->bdf);
4960 4960
4961 if (font->hfont) DeleteObject (font->hfont); 4961 if (font->hfont) DeleteObject (font->hfont);
diff --git a/src/window.c b/src/window.c
index c5e8b56084b..295e45b25a8 100644
--- a/src/window.c
+++ b/src/window.c
@@ -3195,7 +3195,7 @@ size_window (window, size, width_p, nodelete_p, first_only, last_only)
3195 last_pos += new_size; 3195 last_pos += new_size;
3196 } 3196 }
3197 3197
3198 if (new_sizes) xfree (new_sizes); 3198 xfree (new_sizes);
3199 3199
3200 /* We should have covered the parent exactly with child windows. */ 3200 /* We should have covered the parent exactly with child windows. */
3201 xassert (size == last_pos - first_pos); 3201 xassert (size == last_pos - first_pos);
diff --git a/src/xselect.c b/src/xselect.c
index dd5c1dcc6ba..11ee5945a79 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -1673,7 +1673,7 @@ receive_incremental_selection (display, window, property, target_type,
1673 XSelectInput (display, window, STANDARD_EVENT_SET); 1673 XSelectInput (display, window, STANDARD_EVENT_SET);
1674 /* Use xfree, not XFree, because x_get_window_property 1674 /* Use xfree, not XFree, because x_get_window_property
1675 calls xmalloc itself. */ 1675 calls xmalloc itself. */
1676 if (tmp_data) xfree (tmp_data); 1676 xfree (tmp_data);
1677 break; 1677 break;
1678 } 1678 }
1679 1679
diff --git a/src/xterm.c b/src/xterm.c
index a14a8ed20eb..fa7ffe5139e 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -9513,9 +9513,7 @@ x_free_frame_resources (f)
9513 XFlush (FRAME_X_DISPLAY (f)); 9513 XFlush (FRAME_X_DISPLAY (f));
9514 } 9514 }
9515 9515
9516 if (f->output_data.x->saved_menu_event) 9516 xfree (f->output_data.x->saved_menu_event);
9517 xfree (f->output_data.x->saved_menu_event);
9518
9519 xfree (f->output_data.x); 9517 xfree (f->output_data.x);
9520 f->output_data.x = NULL; 9518 f->output_data.x = NULL;
9521 9519
@@ -10522,10 +10520,8 @@ x_delete_display (dpyinfo)
10522 xim_close_dpy (dpyinfo); 10520 xim_close_dpy (dpyinfo);
10523#endif 10521#endif
10524 10522
10525 if (dpyinfo->x_id_name) 10523 xfree (dpyinfo->x_id_name);
10526 xfree (dpyinfo->x_id_name); 10524 xfree (dpyinfo->color_cells);
10527 if (dpyinfo->color_cells)
10528 xfree (dpyinfo->color_cells);
10529 xfree (dpyinfo); 10525 xfree (dpyinfo);
10530} 10526}
10531 10527