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()
This commit is contained in:
Przemyslaw Czerpak
2008-07-22 19:26:09 +00:00
parent faf1b27f38
commit 344830d5f9
3 changed files with 12 additions and 5 deletions

View File

@@ -8,6 +8,11 @@
2008-12-31 13:59 UTC+0100 Foo Bar <foo.bar@foobar.org>
*/
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

View File

@@ -40,6 +40,7 @@ woven in by Terry Thorsen 1/2003.
#include <string.h>
#include "hbzlib.h"
#include "unzip.h"
#include "hbapi.h" /* for hb_xgrab()/hb_xfree() */
#ifdef STDC
# include <stddef.h>
@@ -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)

View File

@@ -16,6 +16,7 @@
#include <time.h>
#include "hbzlib.h"
#include "zip.h"
#include "hbapi.h" /* for hb_xgrab()/hb_xfree() */
#ifdef STDC
# include <stddef.h>
@@ -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)
{