From 1917e9295cb94edf6d8c9f64d7f26d564e4e0804 Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Sun, 11 Jan 2009 22:33:10 -0600 Subject: [PATCH] Don't leak memory in handling of unjournaled state. --- Timeline/Log_Entry.C | 2 ++ Timeline/Loggable.C | 3 +++ 2 files changed, 5 insertions(+) diff --git a/Timeline/Log_Entry.C b/Timeline/Log_Entry.C index 9fbddbc..1a389c2 100644 --- a/Timeline/Log_Entry.C +++ b/Timeline/Log_Entry.C @@ -116,6 +116,8 @@ Log_Entry::print ( void ) const strcpy( r2, r ); + free( r ); + return r2; } diff --git a/Timeline/Loggable.C b/Timeline/Loggable.C index 383d582..b3dd30a 100644 --- a/Timeline/Loggable.C +++ b/Timeline/Loggable.C @@ -697,8 +697,11 @@ Loggable::record_unjournaled ( void ) const if ( e->size() ) _loggables[ _id ].unjournaled_state = e; else + { /* don't waste space on loggables with no unjournaled properties */ _loggables[ _id ].unjournaled_state = NULL; + delete e; + } } /** Log object destruction. *Must* be called at the beginning of the