summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/actions.c10
-rw-r--r--src/completions.c6
-rw-r--r--src/events.c3
-rw-r--r--src/globals.c6
-rw-r--r--src/group.c6
-rw-r--r--src/main.c3
-rw-r--r--src/sbuf.c4
7 files changed, 13 insertions, 25 deletions
diff --git a/src/actions.c b/src/actions.c
index 2d06645..886b99a 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -431,7 +431,7 @@ clear_frame_redos (void)
list_for_each_safe_entry (cur, iter, tmp, &rp_frame_redos, node)
{
- if (cur->frames) free (cur->frames);
+ free (cur->frames);
list_del (&(cur->node));
}
}
@@ -440,7 +440,7 @@ void
del_frame_undo (rp_frame_undo *u)
{
if (!u) return;
- if (u->frames) free (u->frames);
+ free (u->frames);
list_del (&(u->node));
free (u);
}
@@ -831,8 +831,7 @@ cmdret_new (int success, char *fmt, ...)
void
cmdret_free (cmdret *ret)
{
- if (ret->output)
- free (ret->output);
+ free (ret->output);
free (ret);
}
@@ -2422,8 +2421,7 @@ arg_free (struct cmdarg *arg)
if (arg)
{
/* read_frame doesn't fill in string. */
- if (arg->string)
- free (arg->string);
+ free (arg->string);
switch (arg->type)
{
case arg_KEY:
diff --git a/src/completions.c b/src/completions.c
index fc32c38..a047a50 100644
--- a/src/completions.c
+++ b/src/completions.c
@@ -53,8 +53,7 @@ completions_free (rp_completions *c)
}
/* Free the partial string. */
- if (c->partial)
- free (c->partial);
+ free (c->partial);
free (c);
}
@@ -88,8 +87,7 @@ completions_update (rp_completions *c, char *partial)
new_list = c->complete_fn (partial);
c->virgin = 0;
- if (c->partial)
- free (c->partial);
+ free (c->partial);
c->partial = xstrdup (partial);
completions_assign (c, new_list);
diff --git a/src/events.c b/src/events.c
index 37bfc01..8c8950d 100644
--- a/src/events.c
+++ b/src/events.c
@@ -788,8 +788,7 @@ selection_request (XSelectionRequestEvent *rq)
static void
selection_clear (void)
{
- if (selection.text)
- free (selection.text);
+ free (selection.text);
selection.text = NULL;
selection.len = 0;
}
diff --git a/src/globals.c b/src/globals.c
index 233f2ae..f81d7ad 100644
--- a/src/globals.c
+++ b/src/globals.c
@@ -108,8 +108,7 @@ set_nselection (char *txt, int len)
int i;
/* Update the selection structure */
- if (selection.text != NULL)
- free(selection.text);
+ free (selection.text);
/* Copy the string by hand. */
selection.text = malloc(len+1);
@@ -125,8 +124,7 @@ void
set_selection (char *txt)
{
/* Update the selection structure */
- if (selection.text != NULL)
- free(selection.text);
+ free (selection.text);
selection.text = xstrdup (txt);
selection.len = strlen (txt);
diff --git a/src/group.c b/src/group.c
index 2bbfead..348ffcc 100644
--- a/src/group.c
+++ b/src/group.c
@@ -144,8 +144,7 @@ group_new (int number, char *name)
void
group_free (rp_group *g)
{
- if (g->name)
- free (g->name);
+ free (g->name);
numset_free (g->numset);
numset_release (group_numset, g->number);
free (g);
@@ -195,8 +194,7 @@ group_resort_group (rp_group *g)
void
group_rename (rp_group *g, char *name)
{
- if (g->name)
- free (g->name);
+ free (g->name);
g->name = xstrdup (name);
}
diff --git a/src/main.c b/src/main.c
index ab1f592..f8d3fed 100644
--- a/src/main.c
+++ b/src/main.c
@@ -297,8 +297,7 @@ handler (Display *d, XErrorEvent *e)
/* If there is already an error to report, replace it with this new
one. */
- if (rp_error_msg)
- free (rp_error_msg);
+ free (rp_error_msg);
rp_error_msg = xstrdup (error_msg);
return 0;
diff --git a/src/sbuf.c b/src/sbuf.c
index 055006d..d85ed47 100644
--- a/src/sbuf.c
+++ b/src/sbuf.c
@@ -46,9 +46,7 @@ sbuf_free (struct sbuf *b)
{
if (b != NULL)
{
- if (b->data != NULL)
- free (b->data);
-
+ free (b->data);
free (b);
}
}