diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 374127d092..6fb7ea51dd 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,11 @@ 2008-12-31 13:59 UTC+0100 Foo Bar */ +2008-07-22 21:25 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/contrib/hbmzip/zip.c + * harbour/contrib/hbmzip/unzip.c + * use hb_xgrab()/hb_xfree() instead of malloc()/free() + 2008-07-22 19:27 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/contrib/hbmzip/zip.c * set OS version information in ZIP header when ZIP archive is diff --git a/harbour/contrib/hbmzip/unzip.c b/harbour/contrib/hbmzip/unzip.c index 834a82bbb9..fe59818aa0 100644 --- a/harbour/contrib/hbmzip/unzip.c +++ b/harbour/contrib/hbmzip/unzip.c @@ -40,6 +40,7 @@ woven in by Terry Thorsen 1/2003. #include #include "hbzlib.h" #include "unzip.h" +#include "hbapi.h" /* for hb_xgrab()/hb_xfree() */ #ifdef STDC # include @@ -76,10 +77,10 @@ woven in by Terry Thorsen 1/2003. #endif #ifndef ALLOC -# define ALLOC(size) (malloc(size)) +# define ALLOC(size) hb_xgrab(size) #endif #ifndef TRYFREE -# define TRYFREE(p) {if (p) free(p);} +# define TRYFREE(p) do {if (p) hb_xfree(p);} while( 0 ) #endif #define SIZECENTRALDIRITEM (0x2e) diff --git a/harbour/contrib/hbmzip/zip.c b/harbour/contrib/hbmzip/zip.c index be1c6b54ce..4ffeadec61 100644 --- a/harbour/contrib/hbmzip/zip.c +++ b/harbour/contrib/hbmzip/zip.c @@ -16,6 +16,7 @@ #include #include "hbzlib.h" #include "zip.h" +#include "hbapi.h" /* for hb_xgrab()/hb_xfree() */ #ifdef STDC # include @@ -57,10 +58,10 @@ #endif #ifndef ALLOC -# define ALLOC(size) (malloc(size)) +# define ALLOC(size) hb_xgrab(size) #endif #ifndef TRYFREE -# define TRYFREE(p) {if (p) free(p);} +# define TRYFREE(p) do {if (p) hb_xfree(p);} while( 0 ) #endif /* @@ -1107,7 +1108,7 @@ extern int ZEXPORT zipCloseFileInZipRaw ( if (err==ZIP_OK) err = add_data_in_datablock(&zi->central_dir,zi->ci.central_header, (uLong)zi->ci.size_centralheader); - free(zi->ci.central_header); + TRYFREE(zi->ci.central_header); if (err==ZIP_OK) {