aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJim Meyering2008-06-02 06:00:54 +0000
committerJim Meyering2008-06-02 06:00:54 +0000
commitc2cd06e61e6f21eeb1077b557a22cc5aaf795676 (patch)
treeec7d44c58c8b7f4a84065a04163351dc9c96f552 /src
parent437eedba09d67a807d2547886bd3e8fae81138a3 (diff)
downloademacs-c2cd06e61e6f21eeb1077b557a22cc5aaf795676.tar.gz
emacs-c2cd06e61e6f21eeb1077b557a22cc5aaf795676.zip
remove useless if-before-free tests
* lib-src/ebrowse.c (xfree): Likewise. * lib-src/etags.c (process_file_name, free_tree, free_fdesc): Likewise. (popclass_above, Prolog_functions, Erlang_functions): Likewise. * lib-src/pop.c (pop_quit): Likewise. * lwlib/lwlib-Xm.c (xm_update_one_value): Likewise. * lwlib/lwlib.c (safe_free_str, free_widget_value_tree): Likewise. * src/editfns.c (Fset_time_zone_rule): Likewise. * src/lread.c (nosuffix): Likewise. * src/ralloc.c (get_bloc): Likewise. * src/regex.c (reg_free): Likewise. * src/xftfont.c (xftfont_open, xftfont_close): Likewise. * src/xrdb.c (get_user_app, get_environ_db, x_load_resources): Likewise. * src/xsmfns.c (smc_save_yourself_CB): Likewise.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog11
-rw-r--r--src/editfns.c3
-rw-r--r--src/lread.c3
-rw-r--r--src/ralloc.c3
-rw-r--r--src/regex.c9
-rw-r--r--src/xrdb.c13
-rw-r--r--src/xsmfns.c3
7 files changed, 23 insertions, 22 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 2095834d527..5d071f0c764 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,14 @@
12008-06-02 Jim Meyering <meyering@redhat.com>
2
3 remove useless if-before-free tests
4 * src/editfns.c (Fset_time_zone_rule): Likewise.
5 * src/lread.c (nosuffix): Likewise.
6 * src/ralloc.c (get_bloc): Likewise.
7 * src/regex.c (reg_free): Likewise.
8 * src/xftfont.c (xftfont_open, xftfont_close): Likewise.
9 * src/xrdb.c (get_user_app, get_environ_db, x_load_resources): Likewise.
10 * src/xsmfns.c (smc_save_yourself_CB): Likewise.
11
12008-06-02 Kenichi Handa <handa@m17n.org> 122008-06-02 Kenichi Handa <handa@m17n.org>
2 13
3 * font.c (font_find_for_lface): Handle float font size. 14 * font.c (font_find_for_lface): Handle float font size.
diff --git a/src/editfns.c b/src/editfns.c
index 95ad2f1aaaf..192277e4295 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -2038,8 +2038,7 @@ If TZ is t, use Universal Time. */)
2038 } 2038 }
2039 2039
2040 set_time_zone_rule (tzstring); 2040 set_time_zone_rule (tzstring);
2041 if (environbuf) 2041 free (environbuf);
2042 free (environbuf);
2043 environbuf = environ; 2042 environbuf = environ;
2044 2043
2045 return Qnil; 2044 return Qnil;
diff --git a/src/lread.c b/src/lread.c
index 1bc9ec3ee0d..578addf1329 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -1269,8 +1269,7 @@ Return t if the file exists and loads successfully. */)
1269 1269
1270 UNGCPRO; 1270 UNGCPRO;
1271 1271
1272 if (saved_doc_string) 1272 free (saved_doc_string);
1273 free (saved_doc_string);
1274 saved_doc_string = 0; 1273 saved_doc_string = 0;
1275 saved_doc_string_size = 0; 1274 saved_doc_string_size = 0;
1276 1275
diff --git a/src/ralloc.c b/src/ralloc.c
index 652cf3089a3..1c988283dbc 100644
--- a/src/ralloc.c
+++ b/src/ralloc.c
@@ -425,8 +425,7 @@ get_bloc (size)
425 if (! (new_bloc = (bloc_ptr) malloc (BLOC_PTR_SIZE)) 425 if (! (new_bloc = (bloc_ptr) malloc (BLOC_PTR_SIZE))
426 || ! (new_bloc->data = obtain (break_value, size))) 426 || ! (new_bloc->data = obtain (break_value, size)))
427 { 427 {
428 if (new_bloc) 428 free (new_bloc);
429 free (new_bloc);
430 429
431 return 0; 430 return 0;
432 } 431 }
diff --git a/src/regex.c b/src/regex.c
index cbc67568743..8ffd2be6ded 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -6841,20 +6841,17 @@ void
6841regfree (preg) 6841regfree (preg)
6842 regex_t *preg; 6842 regex_t *preg;
6843{ 6843{
6844 if (preg->buffer != NULL) 6844 free (preg->buffer);
6845 free (preg->buffer);
6846 preg->buffer = NULL; 6845 preg->buffer = NULL;
6847 6846
6848 preg->allocated = 0; 6847 preg->allocated = 0;
6849 preg->used = 0; 6848 preg->used = 0;
6850 6849
6851 if (preg->fastmap != NULL) 6850 free (preg->fastmap);
6852 free (preg->fastmap);
6853 preg->fastmap = NULL; 6851 preg->fastmap = NULL;
6854 preg->fastmap_accurate = 0; 6852 preg->fastmap_accurate = 0;
6855 6853
6856 if (preg->translate != NULL) 6854 free (preg->translate);
6857 free (preg->translate);
6858 preg->translate = NULL; 6855 preg->translate = NULL;
6859} 6856}
6860WEAK_ALIAS (__regfree, regfree) 6857WEAK_ALIAS (__regfree, regfree)
diff --git a/src/xrdb.c b/src/xrdb.c
index e199c60a798..961f2748b58 100644
--- a/src/xrdb.c
+++ b/src/xrdb.c
@@ -431,13 +431,11 @@ get_user_app (class)
431 { 431 {
432 XrmDatabase db = XrmGetFileDatabase (file); 432 XrmDatabase db = XrmGetFileDatabase (file);
433 free (file); 433 free (file);
434 if (free_it) 434 free (free_it);
435 free (free_it);
436 return db; 435 return db;
437 } 436 }
438 437
439 if (free_it) 438 free (free_it);
440 free (free_it);
441 return NULL; 439 return NULL;
442} 440}
443 441
@@ -504,8 +502,8 @@ get_environ_db ()
504 502
505 db = XrmGetFileDatabase (p); 503 db = XrmGetFileDatabase (p);
506 504
507 if (path) free (path); 505 free (path);
508 if (home) free (home); 506 free (home);
509 507
510 return db; 508 return db;
511} 509}
@@ -612,8 +610,7 @@ x_load_resources (display, xrm_string, myname, myclass)
612 610
613 /* Figure out what the "customization string" is, so we can use it 611 /* Figure out what the "customization string" is, so we can use it
614 to decode paths. */ 612 to decode paths. */
615 if (x_customization_string) 613 free (x_customization_string);
616 free (x_customization_string);
617 x_customization_string 614 x_customization_string
618 = x_get_customization_string (user_database, myname, myclass); 615 = x_get_customization_string (user_database, myname, myclass);
619 616
diff --git a/src/xsmfns.c b/src/xsmfns.c
index 538698a2782..ecbf2596e01 100644
--- a/src/xsmfns.c
+++ b/src/xsmfns.c
@@ -262,8 +262,7 @@ smc_save_yourself_CB (smcConn,
262 262
263 xfree (smid_opt); 263 xfree (smid_opt);
264 264
265 if (cwd) 265 free (cwd);
266 free (cwd);
267 266
268 /* See if we maybe shall interact with the user. */ 267 /* See if we maybe shall interact with the user. */
269 if (interactStyle != SmInteractStyleAny 268 if (interactStyle != SmInteractStyleAny