]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - progs/tic.c
ncurses 6.0 - patch 20150704
[ncurses.git] / progs / tic.c
index 8182e2eea7aa9d8a0f2c1d4682bfac67c5d1dbe0..10cc4d2d606362fb6bb3b7f6e797fd032f763402 100644 (file)
@@ -48,7 +48,7 @@
 #include <parametrized.h>
 #include <transform.h>
 
-MODULE_ID("$Id: tic.c,v 1.210 2015/05/27 00:58:18 tom Exp $")
+MODULE_ID("$Id: tic.c,v 1.211 2015/07/04 21:12:41 tom Exp $")
 
 #define STDIN_NAME "<stdin>"
 
@@ -2337,13 +2337,15 @@ check_termtype(TERMTYPE *tp, bool literal)
                      ("will trim sgr0\n\toriginal sgr0=%s\n\ttrimmed  sgr0=%s",
                       _nc_visbuf2(1, exit_attribute_mode),
                       _nc_visbuf2(2, check_sgr0)));
-               free(check_sgr0);
            } else {
                DEBUG(2,
                      ("will not trim sgr0\n\toriginal sgr0=%s",
                       _nc_visbuf(exit_attribute_mode)));
            }
        }
+       if (check_sgr0 != exit_attribute_mode) {
+           free(check_sgr0);
+       }
     }
 #ifdef TRACE
     show_where(2);