From f6892bbab39f39925c44652e8f904cb632e8c693 Mon Sep 17 00:00:00 2001 From: Douglas Clowes Date: Mon, 14 Apr 2008 09:47:50 +1000 Subject: [PATCH] fix memory leak (but only on malloc path) r2428 | dcl | 2008-04-14 09:47:50 +1000 (Mon, 14 Apr 2008) | 2 lines --- nxscript.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/nxscript.c b/nxscript.c index 1d7375d1..f04b73df 100644 --- a/nxscript.c +++ b/nxscript.c @@ -732,12 +732,14 @@ static void putSlab(SConnection *pCon, SicsInterp *pSics, pNXScript self, hpars[haStart],hpars[haStart]+hpars[haLength],histData, hpars[haLength]*sizeof(HistInt)); } - if(histData){ - status = NXputslab(self->fileHandle, histData, start, size); - if(status == NX_OK){ - written = 1; - } + if(histData){ + status = NXputslab(self->fileHandle, histData, start, size); + if(status == NX_OK){ + written = 1; } + if (argc > 6) + free(histData); + } } /*