From 259ed3055e96263701a2a569f288cb9753c82fb2 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Fri, 4 Nov 2005 14:27:51 +0100 Subject: Fixed a memory leak in cString::operator=() --- CONTRIBUTORS | 1 + HISTORY | 1 + tools.c | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 3c2b9a73..4035d40b 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -794,6 +794,7 @@ Sascha Volkenandt for fixing a crash in cConfig::Load() when compiling on the PPC for reporting '\n' in an esyslog() call in osd.c for reporting missing '&' in the SetAreas() example in PLUGINS.html + for reporting a memory leak in cString::operator=() Malcolm Caldwell for modifying LOF handling to allow for C-band reception diff --git a/HISTORY b/HISTORY index 6aa320b0..7636d240 100644 --- a/HISTORY +++ b/HISTORY @@ -3922,3 +3922,4 @@ Video Disk Recorder Revision History - Removed '\n' from several syslog() calls (reported by Sascha Volkenandt). - Fixed missing '&' in the SetAreas() example in PLUGINS.html (reported by Sascha Volkenandt). +- Fixed a memory leak in cString::operator=() (reported by Sascha Volkenandt). diff --git a/tools.c b/tools.c index 24d8f275..e0a9ecf5 100644 --- a/tools.c +++ b/tools.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: tools.c 1.101 2005/11/04 14:20:04 kls Exp $ + * $Id: tools.c 1.102 2005/11/04 14:26:39 kls Exp $ */ #include "tools.h" @@ -534,6 +534,7 @@ cString::~cString() cString &cString::operator=(const cString &String) { + free(s); s = String.s ? strdup(String.s) : NULL; return *this; } -- cgit v1.2.3