Running this simple program with Purify 3.0, I have noticed unexplicable memory
leaks (19 bytes):
#include <stdlib.h>
#define COMPILE_STYLE CPP_COMPILE
#include <ctpublic.h>
void main()
{
CS_RETCODE retcode;
CS_CONTEXT *_context;
_context = NULL;
// Allocates structure for _context.
if ((retcode = cs_ctx_alloc(CS_VERSION_100,
&_context)) != CS_SUCCEED)
exit(1);
// Initialize Open Client.
if ((retcode = ct_init(_context,
CS_VERSION_100)) != CS_SUCCEED)
{
(void)cs_ctx_drop(_context);
_context = NULL;
exit(1);
}
if (((retcode = ct_exit(_context,
CS_FORCE_EXIT)) != CS_SUCCEED) ||
((retcode = cs_ctx_drop(_context)) != CS_SUCCEED))
exit(1);
exit(0);
Quote:
}
Purify shows 19 bytes leaked with this stack:
This memory was allocated from:
malloc [rtlib.o]
net_init [libtcl.sl]
np_init [libct.sl]
ct_gp_init [libct.sl]
uwss_999 [libct.sl]
ct_init [libct.sl]
Is there anyone that has experienced this problem ?
I am working with HP C++ compiler and Sybase version 10.0.2 with CT-lib ver.
5.0
(I read the file ctpublic.h).
TIA,
Filippo
--
| Filippo Onorato | Senior Software Engineer |
| via dei Castori 13 | Sodalia S.p.A. |
| Martignano, 38040 Trento | via Brennero 364 38100 TN |