M
Michael Rasmussen
Hi all,
Due to input from you I ended up with the solution shown below.
==00:00:00:04.137 7613==
==00:00:00:04.137 7613== ERROR SUMMARY: 130 errors from 7 contexts (suppressed: 17 from 1)
==00:00:00:04.171 7613== malloc/free: in use at exit: 0 bytes in 0 blocks.
==00:00:00:04.171 7613== malloc/free: 37 allocs, 37 frees, 9,839 bytes allocated.
==00:00:00:04.171 7613== For counts of detected errors, rerun with: -v
==00:00:00:04.199 7613== No malloc'd blocks -- no leaks are possible.
Errors mentioned is caused by Valgrind not able to handle an incomplete
struct - typedef struct Foo Foo.
Thank you all for usefull input.
In my class I added this method:
const char *get_cstring(const std::string &) const;
const char *Iwconfig::get_cstring(const std::string &s) const
{
return s.c_str();
}
Every time I need to return a string as const char * I then do this:
return Foo->get_cstring(s);
Due to input from you I ended up with the solution shown below.
==00:00:00:04.137 7613==
==00:00:00:04.137 7613== ERROR SUMMARY: 130 errors from 7 contexts (suppressed: 17 from 1)
==00:00:00:04.171 7613== malloc/free: in use at exit: 0 bytes in 0 blocks.
==00:00:00:04.171 7613== malloc/free: 37 allocs, 37 frees, 9,839 bytes allocated.
==00:00:00:04.171 7613== For counts of detected errors, rerun with: -v
==00:00:00:04.199 7613== No malloc'd blocks -- no leaks are possible.
Errors mentioned is caused by Valgrind not able to handle an incomplete
struct - typedef struct Foo Foo.
Thank you all for usefull input.
In my class I added this method:
const char *get_cstring(const std::string &) const;
const char *Iwconfig::get_cstring(const std::string &s) const
{
return s.c_str();
}
Every time I need to return a string as const char * I then do this:
return Foo->get_cstring(s);