diff --git a/ChangeLog.txt b/ChangeLog.txt index d9dff2bdd4..b54e82b87c 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -5,6 +5,17 @@ * Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment See license at the end of file. */ +2014-07-02 20:56 UTC+0200 Viktor Szakats (vszakats users.noreply.github.com) + * contrib/hbcurl/global.c + ! memory allocation wrappers updated to better mimic behavior + of standard malloc()/realloc()/free()/calloc() + It is particularly important to let free() silently accept NULL + argument. [I chose zero size allocations to return NULL.] + ; Cricital update for anyone using libcurl 7.36.0 or newer + + * README.md + + Thanks note to donators! + 2014-07-02 16:40 UTC+0200 Viktor Szakats (vszakats users.noreply.github.com) * contrib/hbcurl/hbcurl.hbp + added new location of dll dependencies on win diff --git a/README.md b/README.md index 32924ffebc..0b337fc83b 100644 --- a/README.md +++ b/README.md @@ -31,9 +31,9 @@ and interfaces to many popular APIs. You can donate to fund further maintenance of this fork: - * [Gittip](https://www.gittip.com/vszakats/) [](https://www.gittip.com/vszakats/) * [PayPal](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=BPSZQYKXMQJYG) - * [Bitcoin](https://coinbase.com/checkouts/b90e7d8467c3d17f0083f9ad186c3c36) + + Thanks to those who did. # How to Get diff --git a/contrib/hbcurl/global.c b/contrib/hbcurl/global.c index b3644d76c8..dc3696f5ec 100644 --- a/contrib/hbcurl/global.c +++ b/contrib/hbcurl/global.c @@ -50,17 +50,18 @@ static void * hb_curl_xgrab( size_t size ) { - return hb_xgrab( size ); + return size > 0 ? hb_xgrab( size ) : NULL; } static void hb_curl_xfree( void * p ) { - hb_xfree( p ); + if( p ) + hb_xfree( p ); } static void * hb_curl_xrealloc( void * p, size_t size ) { - return hb_xrealloc( p, size ); + return size > 0 ? ( p ? hb_xrealloc( p, size ) : hb_xgrab( size ) ) : NULL; } static char * hb_curl_strdup( const char * s ) @@ -71,11 +72,17 @@ static char * hb_curl_strdup( const char * s ) static void * hb_curl_calloc( size_t nelem, size_t elsize ) { size_t size = nelem * elsize; - void * ptr = hb_xgrab( size ); - memset( ptr, 0, size ); + if( size > 0 ) + { + void * ptr = hb_xgrab( size ); - return ptr; + memset( ptr, 0, size ); + + return ptr; + } + else + return NULL; } HB_FUNC( CURL_GLOBAL_INIT )