@@ -87,6 +87,7 @@ typedef struct {
8787 * Private functions
8888 */
8989static void construct (opal_object_t * stream );
90+ static void destruct (opal_object_t * stream );
9091static int do_open (int output_id , opal_output_stream_t * lds );
9192static int open_file (int i );
9293static void free_descriptor (int output_id );
@@ -120,7 +121,7 @@ static bool syslog_opened = false;
120121#endif
121122static char * redirect_syslog_ident = NULL ;
122123
123- OBJ_CLASS_INSTANCE (opal_output_stream_t , opal_object_t , construct , NULL );
124+ OBJ_CLASS_INSTANCE (opal_output_stream_t , opal_object_t , construct , destruct );
124125
125126/*
126127 * Setup the output stream infrastructure
@@ -536,6 +537,15 @@ static void construct(opal_object_t *obj)
536537 stream -> lds_want_file_append = false;
537538 stream -> lds_file_suffix = NULL ;
538539}
540+ static void destruct (opal_object_t * obj )
541+ {
542+ opal_output_stream_t * stream = (opal_output_stream_t * ) obj ;
543+
544+ if ( NULL != stream -> lds_file_suffix ) {
545+ free (stream -> lds_file_suffix );
546+ stream -> lds_file_suffix = NULL ;
547+ }
548+ }
539549
540550/*
541551 * Back-end of open() and reopen(). Necessary to have it as a
0 commit comments