diff options
author | Kjell Wooding <kjell@cvs.openbsd.org> | 2005-12-20 06:17:37 +0000 |
---|---|---|
committer | Kjell Wooding <kjell@cvs.openbsd.org> | 2005-12-20 06:17:37 +0000 |
commit | dc74e33818e7e64e60fca295fbaff47f4e5c206f (patch) | |
tree | 3fe3db244af810766dc26d5eb01c7d115d960c11 /usr.bin/mg/extend.c | |
parent | 9039a07b0e8eda34651f5dde950c2f6b36f53852 (diff) |
Clean up the ugly casted frees. In one case, this meant eliminating a nasty
struct/union/casting nightmare when building the list of names for filename
completion. In particular, be consistent about strduping and freeing
the list data.
Diffstat (limited to 'usr.bin/mg/extend.c')
-rw-r--r-- | usr.bin/mg/extend.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/usr.bin/mg/extend.c b/usr.bin/mg/extend.c index 217318ad870..a18c7d094a6 100644 --- a/usr.bin/mg/extend.c +++ b/usr.bin/mg/extend.c @@ -1,4 +1,4 @@ -/* $OpenBSD: extend.c,v 1.43 2005/12/20 05:04:28 kjell Exp $ */ +/* $OpenBSD: extend.c,v 1.44 2005/12/20 06:17:36 kjell Exp $ */ /* This file is in the public domain. */ @@ -562,7 +562,7 @@ extend(int f, int n) macro[macrocount - 1].m_funct = funct; maclcur = lp->l_bp; maclcur->l_fp = lp->l_fp; - free((char *)lp); + free(lp); } #endif /* !NO_MACRO */ return ((*funct)(f, n)); @@ -881,10 +881,10 @@ excline(char *line) if ((curmap = name_map(lp->l_text)) == NULL) { ewprintf("No such mode: %s", lp->l_text); status = FALSE; - free((char *)lp); + free(lp); goto cleanup; } - free((char *)lp); + free(lp); bind = BINDARG; break; default: @@ -925,10 +925,10 @@ cleanup: lp = maclcur->l_fp; while (lp != maclcur) { np = lp->l_fp; - free((char *)lp); + free(lp); lp = np; } - free((char *)lp); + free(lp); return (status); } |