From 7dd1df01f979a691d2baba2bc2f937445d0cd19c Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Sat, 24 May 2008 15:42:39 +0000 Subject: [PATCH] Fixed memory leak (though not so interesting, since the strace would exit in this case anyway). CID 985. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25640 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/bin/strace/strace.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/bin/strace/strace.cpp b/src/bin/strace/strace.cpp index 8e77dcb9be..2f4eab896e 100644 --- a/src/bin/strace/strace.cpp +++ b/src/bin/strace/strace.cpp @@ -217,8 +217,10 @@ load_program(const char *const *args, int32 argCount, bool traceLoading) // resolve the program path string programPath; status_t error = find_program(args[0], programPath); - if (error != B_OK) + if (error != B_OK) { + delete[] mutableArgs; return error; + } mutableArgs[0] = programPath.c_str(); // count environment variables