From 8ae6e8e23da452ca0cba388bc341a6e5efaa64d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Lindqvist?= Date: Sat, 14 May 2016 19:00:20 +0200 Subject: [PATCH] VM: safe_strdup needs to be called in vm_executable_path --- vm/os-macosx.mm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vm/os-macosx.mm b/vm/os-macosx.mm index 2b855d4881..ee96bc2016 100644 --- a/vm/os-macosx.mm +++ b/vm/os-macosx.mm @@ -22,8 +22,9 @@ void early_init(void) { } } +/* You must free() this yourself. */ const char* vm_executable_path(void) { - return [[[NSBundle mainBundle] executablePath] UTF8String]; + return safe_strdup([[[NSBundle mainBundle] executablePath] UTF8String]); } const char* default_image_path(void) {