Commit c2cd06e6 authored by Jim Meyering's avatar Jim Meyering

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.
parent 437eedba
2008-06-02 Jim Meyering <meyering@redhat.com>
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.
2008-05-30 Juanma Barranquero <lekktu@gmail.com>
* makefile.w32-in (lisp2): Add minibuffer.elc.
......
......@@ -595,8 +595,7 @@ void
xfree (p)
void *p;
{
if (p)
free (p);
free (p);
}
......
......@@ -1799,8 +1799,8 @@ process_file_name (file, lang)
pfatal (file);
cleanup:
if (compressed_name) free (compressed_name);
if (uncompressed_name) free (uncompressed_name);
free (compressed_name);
free (uncompressed_name);
last_node = NULL;
curfdp = NULL;
return;
......@@ -2179,8 +2179,7 @@ free_tree (np)
{
register node *node_right = np->right;
free_tree (np->left);
if (np->name != NULL)
free (np->name);
free (np->name);
free (np->regex);
free (np);
np = node_right;
......@@ -2195,11 +2194,11 @@ static void
free_fdesc (fdp)
register fdesc *fdp;
{
if (fdp->infname != NULL) free (fdp->infname);
if (fdp->infabsname != NULL) free (fdp->infabsname);
if (fdp->infabsdir != NULL) free (fdp->infabsdir);
if (fdp->taggedfname != NULL) free (fdp->taggedfname);
if (fdp->prop != NULL) free (fdp->prop);
free (fdp->infname);
free (fdp->infabsname);
free (fdp->infabsdir);
free (fdp->taggedfname);
free (fdp->prop);
free (fdp);
}
......@@ -2844,8 +2843,7 @@ popclass_above (bracelev)
nl >= 0 && cstack.bracelev[nl] >= bracelev;
nl--)
{
if (cstack.cname[nl] != NULL)
free (cstack.cname[nl]);
free (cstack.cname[nl]);
cstack.nl = nl;
}
}
......@@ -5521,8 +5519,7 @@ Prolog_functions (inf)
last[len] = '\0';
}
}
if (last != NULL)
free (last);
free (last);
}
......@@ -5700,8 +5697,7 @@ Erlang_functions (inf)
last[len] = '\0';
}
}
if (last != NULL)
free (last);
free (last);
}
......
......@@ -998,8 +998,7 @@ pop_quit (server)
close (server->file);
}
if (server->buffer)
free (server->buffer);
free (server->buffer);
free ((char *) server);
return (ret);
......
2008-06-02 Jim Meyering <meyering@redhat.com>
remove useless if-before-free tests
* lwlib/lwlib-Xm.c (xm_update_one_value): Likewise.
* lwlib/lwlib.c (safe_free_str, free_widget_value_tree): Likewise.
2008-04-18 Stefan Monnier <monnier@iro.umontreal.ca>
* Makefile.in (TOOLKIT_DEFINES): Remove.
......
......@@ -956,15 +956,13 @@ xm_update_one_value (instance, widget, val)
}
else if (class == xmTextWidgetClass)
{
if (val->value)
free (val->value);
free (val->value);
val->value = XmTextGetString (widget);
val->edited = True;
}
else if (class == xmTextFieldWidgetClass)
{
if (val->value)
free (val->value);
free (val->value);
val->value = XmTextFieldGetString (widget);
val->edited = True;
}
......@@ -989,8 +987,7 @@ xm_update_one_value (instance, widget, val)
XtVaGetValues (toggle, XmNset, &set, NULL);
if (set)
{
if (val->value)
free (val->value);
free (val->value);
val->value = safe_strdup (XtName (toggle));
}
}
......
......@@ -170,7 +170,7 @@ static void
safe_free_str (s)
char *s;
{
if (s) free (s);
free (s);
}
static widget_value *widget_value_free_list = 0;
......@@ -226,9 +226,9 @@ free_widget_value_tree (wv)
if (!wv)
return;
if (wv->name) free (wv->name);
if (wv->value) free (wv->value);
if (wv->key) free (wv->key);
free (wv->name);
free (wv->value);
free (wv->key);
wv->name = wv->value = wv->key = (char *) 0xDEADBEEF;
......
2008-06-02 Jim Meyering <meyering@redhat.com>
remove useless if-before-free tests
* 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.
2008-06-02 Kenichi Handa <handa@m17n.org>
* font.c (font_find_for_lface): Handle float font size.
......
......@@ -2038,8 +2038,7 @@ If TZ is t, use Universal Time. */)
}
set_time_zone_rule (tzstring);
if (environbuf)
free (environbuf);
free (environbuf);
environbuf = environ;
return Qnil;
......
......@@ -1269,8 +1269,7 @@ Return t if the file exists and loads successfully. */)
UNGCPRO;
if (saved_doc_string)
free (saved_doc_string);
free (saved_doc_string);
saved_doc_string = 0;
saved_doc_string_size = 0;
......
......@@ -425,8 +425,7 @@ get_bloc (size)
if (! (new_bloc = (bloc_ptr) malloc (BLOC_PTR_SIZE))
|| ! (new_bloc->data = obtain (break_value, size)))
{
if (new_bloc)
free (new_bloc);
free (new_bloc);
return 0;
}
......
......@@ -6841,20 +6841,17 @@ void
regfree (preg)
regex_t *preg;
{
if (preg->buffer != NULL)
free (preg->buffer);
free (preg->buffer);
preg->buffer = NULL;
preg->allocated = 0;
preg->used = 0;
if (preg->fastmap != NULL)
free (preg->fastmap);
free (preg->fastmap);
preg->fastmap = NULL;
preg->fastmap_accurate = 0;
if (preg->translate != NULL)
free (preg->translate);
free (preg->translate);
preg->translate = NULL;
}
WEAK_ALIAS (__regfree, regfree)
......
......@@ -431,13 +431,11 @@ get_user_app (class)
{
XrmDatabase db = XrmGetFileDatabase (file);
free (file);
if (free_it)
free (free_it);
free (free_it);
return db;
}
if (free_it)
free (free_it);
free (free_it);
return NULL;
}
......@@ -504,8 +502,8 @@ get_environ_db ()
db = XrmGetFileDatabase (p);
if (path) free (path);
if (home) free (home);
free (path);
free (home);
return db;
}
......@@ -612,8 +610,7 @@ x_load_resources (display, xrm_string, myname, myclass)
/* Figure out what the "customization string" is, so we can use it
to decode paths. */
if (x_customization_string)
free (x_customization_string);
free (x_customization_string);
x_customization_string
= x_get_customization_string (user_database, myname, myclass);
......
......@@ -262,8 +262,7 @@ smc_save_yourself_CB (smcConn,
xfree (smid_opt);
if (cwd)
free (cwd);
free (cwd);
/* See if we maybe shall interact with the user. */
if (interactStyle != SmInteractStyleAny
......
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