diff options
Diffstat (limited to 'lib/util/mallocvar.h')
-rw-r--r-- | lib/util/mallocvar.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/util/mallocvar.h b/lib/util/mallocvar.h index b750e177..1f2be127 100644 --- a/lib/util/mallocvar.h +++ b/lib/util/mallocvar.h @@ -87,6 +87,8 @@ reallocProduct(void ** const blockP, void * array; \ array = arrayName; \ reallocProduct(&array, nElements, sizeof(arrayName[0])); \ + if (!array) \ + free(arrayName); \ arrayName = array; \ } while (0) |