/*
* Copyright (c) 2000-2001 Sendmail, Inc. and its suppliers.
* All rights reserved.
*
* By using this file, you agree to the terms and conditions set
* forth in the LICENSE file which can be found at the top level of
* the sendmail distribution.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#if SM_HEAP_CHECK
extern SM_DEBUG_T SmHeapCheck;
#else /* SM_HEAP_CHECK */
# define HEAP_CHECK 0
#endif /* SM_HEAP_CHECK */
int
int argc;
char **argv;
{
void *p;
if (argc > 1)
p = sm_malloc(10);
p = sm_realloc_x(p, 20);
p = sm_realloc(p, 30);
if (HEAP_CHECK)
{
sm_dprintf("heap with 1 30-byte block allocated:\n");
}
if (HEAP_CHECK)
{
sm_free(p);
sm_dprintf("heap with 0 blocks allocated:\n");
}
#if DEBUG
/* this will cause a core dump */
sm_dprintf("about to free %p for the second time\n", p);
sm_free(p);
#endif /* DEBUG */
return sm_test_end();
}