From ed15b68684bfece9ae322e5fd7434b367cf8ae43 Mon Sep 17 00:00:00 2001 From: imaginos Date: Mon, 17 Mar 2008 19:51:58 +0000 Subject: [PATCH] possible memleak during onload bu pZNCSpace not being mortal git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@986 726aef4b-f618-498e-8847-2d620e286838 --- modules/modperl.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/modperl.cpp b/modules/modperl.cpp index 31abfc28..fb657926 100644 --- a/modules/modperl.cpp +++ b/modules/modperl.cpp @@ -1009,11 +1009,13 @@ bool CModPerl::OnLoad( const CString & sArgs, CString & sMessage ) // this sets up the eval CB that we call from here on out. this way we can grab the error produced SetupZNCScript(); - HV *pZNCSpace = get_hv ( "ZNC::", TRUE); + HV *pZNCSpace = get_hv( "ZNC::", TRUE); if ( !pZNCSpace ) return( false ); + sv_2mortal((SV*)pZNCSpace); + newCONSTSUB( pZNCSpace, "CONTINUE", newSViv( CONTINUE ) ); newCONSTSUB( pZNCSpace, "HALT", newSViv( HALT ) ); newCONSTSUB( pZNCSpace, "HALTMODS", newSViv( HALTMODS ) );