From c92f2bec7b3249c3365c76f87ab1384d0adb7844 Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Thu, 18 Sep 2008 17:28:39 +0000 Subject: [PATCH] 2008-09-18 19:28 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/source/rdd/dbfcdx/dbfcdx1.c ! fixed memory leak - Many thanks to Miguel for report --- harbour/ChangeLog | 4 ++++ harbour/source/rdd/dbfcdx/dbfcdx1.c | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 351dc6f7d4..715838c8f2 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,10 @@ 2008-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org) */ +2008-09-18 19:28 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/source/rdd/dbfcdx/dbfcdx1.c + ! fixed memory leak - Many thanks to Miguel for report + 2008-09-18 17:24 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/make_rpm.sh * use rpm to test if curl-devel package is installed diff --git a/harbour/source/rdd/dbfcdx/dbfcdx1.c b/harbour/source/rdd/dbfcdx/dbfcdx1.c index 1691e361ff..0c0aeff8f9 100644 --- a/harbour/source/rdd/dbfcdx/dbfcdx1.c +++ b/harbour/source/rdd/dbfcdx/dbfcdx1.c @@ -7383,15 +7383,15 @@ static ERRCODE hb_cdxOrderCreate( CDXAREAP pArea, LPDBORDERCREATEINFO pOrderInfo if( pArea->lpdbPendingRel ) SELF_FORCEREL( ( AREAP ) pArea ); - if( SELF_COMPILE( (AREAP) pArea, ( BYTE * ) hb_itemGetCPtr( pOrderInfo->abExpr ) ) == FAILURE ) - return FAILURE; - if( hb_strlentrim( hb_itemGetCPtr( pOrderInfo->abExpr ) ) + ( pArea->lpdbOrdCondInfo && pArea->lpdbOrdCondInfo->abFor ? hb_strlentrim( ( const char * ) pArea->lpdbOrdCondInfo->abFor ) : 0 ) > CDX_HEADEREXPLEN - 2 ) return hb_cdxErrorRT( pArea, EG_DATAWIDTH, EDBF_KEYLENGTH, NULL, 0, 0 ); + if( SELF_COMPILE( (AREAP) pArea, ( BYTE * ) hb_itemGetCPtr( pOrderInfo->abExpr ) ) == FAILURE ) + return FAILURE; + pKeyExp = pArea->valResult; pArea->valResult = NULL; /* If we have a codeblock for the expression, use it */