Do not crash if there is no module for the given address.
Signed-off-by: Pino Toscano <toscano.pino@tiscali.it>
+2015-06-27 Pino Toscano <toscano.pino@tiscali.it>
+
+ * tests/dwfl-bug-fd-leak.c (elfutils_open): Check for null results of
+ dwfl_addrmodule.
+
2015-06-26 Pino Toscano <toscano.pino@tiscali.it>
* tests/vdsosyms.c [!__linux__] (main): Mark argv as unused.
}
else
{
- Elf *elf = dwfl_module_getelf (dwfl_addrmodule (dwfl, address), &bias);
+ Dwfl_Module *module = dwfl_addrmodule (dwfl, address);
+ if (module == NULL)
+ error (2, 0, "dwfl_addrmodule: no module available for 0x%" PRIx64 "",
+ address);
+ Elf *elf = dwfl_module_getelf (module, &bias);
if (elf == NULL)
error (2, 0, "dwfl_module_getelf: %s", dwfl_errmsg (-1));
}