bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Double free in _nc_free_termtype() (sort of)


From: Jason Evans
Subject: Double free in _nc_free_termtype() (sort of)
Date: Sat, 17 Nov 2001 21:48:01 -0800
User-agent: Mutt/1.2.5i

_nc_free_termtype() frees ptr->term_names, which is (according to comments
in term.h) a pointer to something inside of ptr->str_table.  Therefore,
ptr->term_names should not be freed.  The following patch addresses this
problem.

Thanks,
Jason

--- free_ttype.c.orig   Thu Jan  1 16:15:16 1970
+++ free_ttype.c        Thu Jan  1 16:15:36 1970
@@ -49,7 +49,6 @@
 _nc_free_termtype(TERMTYPE * ptr)
 {
     FreeIfNeeded(ptr->str_table);
-    FreeIfNeeded(ptr->term_names);
     FreeIfNeeded(ptr->Booleans);
     FreeIfNeeded(ptr->Numbers);
     FreeIfNeeded(ptr->Strings);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]