audiod: Fix a memory leak.
[paraslash.git] / string.c
index 598a12f510ecef9cefe13811a848d89cfb90d9a8..8b9f1633d95be658c7a6ecc40f291a0e033943bd 100644 (file)
--- a/string.c
+++ b/string.c
@@ -36,6 +36,7 @@ __must_check __malloc void *para_realloc(void *p, size_t size)
         * No need to check for NULL pointers: If p is NULL, the  call
         * to realloc is equivalent to malloc(size)
         */
+       assert(size);
        if (!(p = realloc(p, size))) {
                PARA_EMERG_LOG("realloc failed (size = %zu), aborting\n",
                        size);
@@ -58,6 +59,7 @@ __must_check __malloc void *para_realloc(void *p, size_t size)
  */
 __must_check __malloc void *para_malloc(size_t size)
 {
+       assert(size);
        void *p = malloc(size);
 
        if (!p) {