From 2760c4cd733828c6febde911ddfe321cd363601c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Tue, 2 Oct 2007 13:17:19 +0000 Subject: [PATCH] * load_program() (and probably others) could call delete_image() with a NULL pointer - which it now handles gracefully. * This also fixes starting the runtime loader directly: it no longer crashes but will just return an error. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22409 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/runtime_loader/elf.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/system/runtime_loader/elf.cpp b/src/system/runtime_loader/elf.cpp index 02e8c547e8..819fbe9ac6 100644 --- a/src/system/runtime_loader/elf.cpp +++ b/src/system/runtime_loader/elf.cpp @@ -370,6 +370,9 @@ delete_image_struct(image_t *image) static void delete_image(image_t *image) { + if (image == NULL) + return; + _kern_unregister_image(image->id); // registered in load_container()