diff options
author | Timo Schulz <twoaday@freakmail.de> | 2002-01-01 11:26:05 +0000 |
---|---|---|
committer | Timo Schulz <twoaday@freakmail.de> | 2002-01-01 11:26:05 +0000 |
commit | 01cbc7529f6ced95c72ead856f3c703905586783 (patch) | |
tree | 99dba02d7836997c960de6c91755f767eda0ddf4 /src | |
parent | 4041bd7556742f414c6b9c13fa4f984bb1b83f70 (diff) | |
download | libgcrypt-01cbc7529f6ced95c72ead856f3c703905586783.tar.gz |
Fixed a bug in the memory allocation.
Diffstat (limited to 'src')
-rw-r--r-- | src/ChangeLog | 5 | ||||
-rw-r--r-- | src/stdmem.c | 3 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 547ac5f7..5deb6ee4 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2002-01-01 Timo Schulz <ts@winpt.org> + + * stdmem.c (_gcry_private_realloc): if pointer is NULL now + realloc behaves like malloc. + 2001-12-20 Werner Koch <wk@gnupg.org> * sexp.c (gcry_sexp_canon_len): Describe the error codes and diff --git a/src/stdmem.c b/src/stdmem.c index fe459bd5..d27b4aa0 100644 --- a/src/stdmem.c +++ b/src/stdmem.c @@ -113,6 +113,9 @@ _gcry_private_realloc( void *a, size_t n ) void *b; size_t len; + if (!a) + return _gcry_private_malloc(n); + _gcry_private_check_heap(p); len = p[-4]; len |= p[-3] << 8; |