Index: runtime/bin/platform.h |
diff --git a/runtime/bin/platform.h b/runtime/bin/platform.h |
index b4c10a22fa8eeb82a66fa674776aa77e5514c169..1f52ef96d4125daad5ef9ed863bdaeea15be148e 100644 |
--- a/runtime/bin/platform.h |
+++ b/runtime/bin/platform.h |
@@ -69,7 +69,10 @@ class Platform { |
static const char* GetResolvedExecutableName() { |
if (resolved_executable_name_ == NULL) { |
// Try to resolve the executable path using platform specific APIs. |
- resolved_executable_name_ = strdup(Platform::ResolveExecutablePath()); |
+ const char* resolved_name = Platform::ResolveExecutablePath(); |
+ if (resolved_name != NULL) { |
+ resolved_executable_name_ = strdup(resolved_name); |
+ } |
} |
return resolved_executable_name_; |
} |