summaryrefslogtreecommitdiff
path: root/src/actions.c
diff options
context:
space:
mode:
authorJérémie Courrèges-Anglas <jca@wxcvbn.org>2014-01-03 22:18:51 +0100
committerJérémie Courrèges-Anglas <jca@wxcvbn.org>2014-01-03 23:06:29 +0100
commitb8d5ca85d9a6e6f42b8dbd6d47cab7bbcffeea90 (patch)
treea64f9b23e4f98279712d3d29bd37659996ce4c39 /src/actions.c
parent268732324fd37d9b001694a9206a66cce6681c20 (diff)
downloadratpoison-b8d5ca85d9a6e6f42b8dbd6d47cab7bbcffeea90.zip
if (ptr) free(ptr) is not a good idiom.
Diffstat (limited to 'src/actions.c')
-rw-r--r--src/actions.c10
1 files changed, 4 insertions, 6 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: