Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
[dev.icinga.com #3409] ido2db_get_cached_object_ids fetches only one object_id and leaves memory fragments #1154
This issue has been migrated from Redmine: https://dev.icinga.com/issues/3409
Created by abraxas on 2012-10-29 02:35:43 +00:00
ido2db_get_cached_object_ids does issue a select of all object_ids in the database, but within the while loop idi->dbinfo.dbi_result is freed and set to NULL preventing retrieval of any object_ids beyond the first. This step should only be called if the dbi_result_next_row returns 0. dbi_result_free should be called even if the SELECT call does return IDO_ERROR.
Additionaly dbi_result_get_string_copy (returns an allocated string) is handed over to ido2db_add_cached_object_id which created it's own allocated string via strdup. This leaks memory. As this function is only called during startup phase, the memory does not grow over time and the leaked memory is minimal.
2012-10-29 18:59:49 +00:00 by mfriedrich 60124e9
2012-10-29 19:17:36 +00:00 by mfriedrich 74dea3f
Updated by mfriedrich on 2012-10-29 19:21:18 +00:00
without a fix
with the fix
thanks for the finding, fixes are up in git 'dev/ido' soon.