changeset 32712:f106f30da574 stable

Avoid leaking memory for m_conv_ostream in base_stream. * libinterp/corefcn/oct-stream.h (base_stream::~base_stream): Delete potentially created output stream with wrapper for encoding facet in destructor.
author Markus Mützel <markus.muetzel@gmx.de>
date Wed, 10 Jan 2024 08:53:02 +0100
parents c3a339799a27
children 749f0138640a 281ca190fe97
files libinterp/corefcn/oct-stream.h
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/oct-stream.h	Tue Jan 09 07:46:45 2024 -0800
+++ b/libinterp/corefcn/oct-stream.h	Wed Jan 10 08:53:02 2024 +0100
@@ -81,7 +81,10 @@
 
   OCTAVE_DISABLE_COPY_MOVE (base_stream)
 
-  virtual ~base_stream () = default;
+  virtual ~base_stream ()
+  {
+    delete m_conv_ostream;
+  }
 
   // The remaining functions are not specific to input or output only,
   // and must be provided by the derived classes.