From b8d5ca85d9a6e6f42b8dbd6d47cab7bbcffeea90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Courr=C3=A8ges-Anglas?= Date: Fri, 3 Jan 2014 22:18:51 +0100 Subject: if (ptr) free(ptr) is not a good idiom. --- src/actions.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/actions.c') 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: -- cgit v1.2.3