|
From: geaaru <ge...@gm...> - 2007-09-06 14:36:45
|
Hi at all,
i have a problem to understand valgrind message:
==26868== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 5 from 1)
==26868== malloc/free: in use at exit: 11,545 bytes in 69 blocks.
==26868== malloc/free: 231 allocs, 162 frees, 18,970 bytes allocated.
==26868== For counts of detected errors, rerun with: -v
==26868== searching for pointers to 69 not-freed blocks.
==26868== checked 95,464 bytes.
==26868==
==26868== 66 (48 direct, 18 indirect) bytes in 1 blocks are definitely
lost in loss record 10 of 25
==26868== at 0x4A20E7B: malloc
(in /usr/lib64/valgrind/amd64-linux/vgpreload_memcheck.so)
==26868== by 0x4C6B629: easydbus_create_ext_signal_core
(register_signal.c:73)
==26868== by 0x4012C7: register_object (easydbus_example_obj.c:145)
==26868== by 0x401470: main (easydbus_example_obj.c:94)
In particular, error indicate line 73 of easydbus_create_ext_signal_core
function, where it is allocated an area of memory in this way:
73 ext_signal = (struct EasyDbus_ext_signal_core *)
74 malloc (sizeof (struct EasyDbus_ext_signal_core));
75
76 if (ext_signal == NULL) return NULL;
77 memset (ext_signal, 0,
78 sizeof (struct EasyDbus_ext_signal_core));
and where struct EasyDbus_ext_signal_core is so defined:
struct EasyDbus_ext_signal_core {
char *signal;
char *path;
char *interface;
char *sender;
enum easydbus_ret_values
(* signal_callback)(struct EasyDbus_data *,
struct EasyDbus_signal *);
struct EasyDbus_ext_signal_core *next;
};
Where is error?
Thanks in advance for your reply.
Bye
Ge@@ru
|