From 0c397beb9cb3f1cb6a9621b71fb0ef4529c35b78 Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Sat, 13 Sep 2008 00:10:40 +0000 Subject: [PATCH] CID 1021: Move NULL check before dereferencing "string" in the TRACE statement. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27468 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/kernel/file_systems/iso9660/iso9660_identify.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/add-ons/kernel/file_systems/iso9660/iso9660_identify.cpp b/src/add-ons/kernel/file_systems/iso9660/iso9660_identify.cpp index a1582f063e..3af78f9065 100644 --- a/src/add-ons/kernel/file_systems/iso9660/iso9660_identify.cpp +++ b/src/add-ons/kernel/file_systems/iso9660/iso9660_identify.cpp @@ -196,11 +196,12 @@ void iso9660_info::_SetString(char **string, const char *newString, uint32 newLength) { - TRACE(("iso9660_info::set_string(%p ('%s'), '%s', %ld)\n", string, - *string, newString, newLength)); if (string == NULL) return; + TRACE(("iso9660_info::set_string(%p ('%s'), '%s', %ld)\n", string, + *string, newString, newLength)); + char *&oldString = *string; free(oldString);