From 79f012b76eba04d50a36a4a37c57458a8d521434 Mon Sep 17 00:00:00 2001 From: David Levine Date: Sat, 25 Jun 2016 21:19:37 -0400 Subject: [PATCH] Moved free(cp) to right after last (and only) use of cp. The statement was flagged by gcc 6 -Wmisleading-indentation. In its original location, it would not always have been called, resulting in leaked memory. --- uip/mhlsbr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uip/mhlsbr.c b/uip/mhlsbr.c index 3bc08085..9a35a816 100644 --- a/uip/mhlsbr.c +++ b/uip/mhlsbr.c @@ -908,6 +908,7 @@ process (char *folder, char *fname, int ofilen, int ofilec) if (ontty != PITTY) SIGNAL (SIGINT, intrser); mhlfile (fp, cp, ofilen, ofilec); /* FALL THROUGH! */ + free (cp); for (ap = arglist_head; ap; ap = ap->a_next) { fmt_free(ap->a_fmt, 0); @@ -922,7 +923,6 @@ process (char *folder, char *fname, int ofilen, int ofilec) SIGNAL (SIGINT, SIG_IGN); if (mhl_action == NULL && fp != stdin && fp != NULL) fclose (fp); - free (cp); if (holder.c_text) { free (holder.c_text); holder.c_text = NULL; -- 2.48.1