David,
This simple fortran program:
* Simple link test of AST for the fortran interface
PROGRAM AST_FTEST
INCLUDE 'AST_PAR'
INTEGER STATUS
INTEGER FITSCHAN
STATUS = 0
CALL AST_BEGIN( STATUS )
FITSCHAN = AST_FITSCHAN( AST_NULL, AST_NULL,
: ' ', STATUS )
CALL AST_ANNUL( FITSCHAN, STATUS )
CALL AST_END( STATUS )
END
leaks memory. Do you know what I am doing wrong? (this is a cut down
version of some code from SURF - it gets worse if a real fits header
is stored).
valgrind reports:
==14293== 52 bytes in 3 blocks are possibly lost in loss record 1 of 2
==14293== at 0x4002965E: malloc (vg_replace_malloc.c:153)
==14293== by 0x4030CB4C: astMalloc_ (memory.c:707)
==14293== by 0x4030CA3C: astGrow_ (memory.c:489)
==14293== by 0x4030E1E5: astSetCopy_ (object.c:1781)
==14293== by 0x402590FA: astInitFitsChanVtab_ (fitschan.c:14077)
==14293== by 0x40271C57: astInitFitsChan_ (fitschan.c:32585)
==14293== by 0x40271BC4: astFitsChanForId_ (fitschan.c:32419)
==14293== by 0x4024622F: ast_fitschan_ (ffitschan.c:253)
==14293==
==14293==
==14293== 64 bytes in 4 blocks are possibly lost in loss record 2 of 2
==14293== at 0x40029BD8: realloc (vg_replace_malloc.c:310)
==14293== by 0x4030CC33: astRealloc_ (memory.c:833)
==14293== by 0x4030CA72: astGrow_ (memory.c:506)
==14293== by 0x4030F616: astBegin_ (object.c:3686)
==14293== by 0x402743C7: ast_begin_ (fobject.c:86)
==14293== by 0x80487A1: MAIN__ (in /export/data/timj/tmp/star/cvs/libraries/ast/a.out)
==14293== by 0x8048845: main (in /export/data/timj/tmp/star/cvs/libraries/ast/a.out)
==14293== by 0x4045AAB6: __libc_start_main (in /lib/libc-2.3.2.so)
--
Tim Jenness
JAC software
http://www.jach.hawaii.edu/~timj
|