diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2013-04-14 22:41:31 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2013-04-14 22:41:31 +0000 |
commit | 476b4debea1a9e55b57135e61efb63b7661efc8a (patch) | |
tree | b26521b4802616920883d7a13422d475a235a89f /lib | |
parent | fb7dfd81f5b11462f8ab091e25223375fe6877ae (diff) | |
download | netpbm-mirror-476b4debea1a9e55b57135e61efb63b7661efc8a.tar.gz netpbm-mirror-476b4debea1a9e55b57135e61efb63b7661efc8a.tar.xz netpbm-mirror-476b4debea1a9e55b57135e61efb63b7661efc8a.zip |
Fix bug: REALLOCARRAY tries to free null pointer when block wasn't previously allocated at all and new allocation fails
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@1881 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/util/mallocvar.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/util/mallocvar.h b/lib/util/mallocvar.h index 31ad38bc..e92e3fe4 100644 --- a/lib/util/mallocvar.h +++ b/lib/util/mallocvar.h @@ -87,7 +87,7 @@ reallocProduct(void ** const blockP, void * array; \ array = arrayName; \ reallocProduct(&array, nElements, sizeof(arrayName[0])); \ - if (!array) \ + if (!array && arrayName) \ free(arrayName); \ arrayName = array; \ } while (0) |