From c002d59f5023b85db7db9e11f6e06a4dda9941a8 Mon Sep 17 00:00:00 2001 From: Cristy Date: Sat, 7 Oct 2017 16:43:37 -0400 Subject: [PATCH] ... --- MagickCore/utility.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/MagickCore/utility.c b/MagickCore/utility.c index 1306ecc4c..06b3c8d54 100644 --- a/MagickCore/utility.c +++ b/MagickCore/utility.c @@ -1058,8 +1058,7 @@ MagickPrivate MagickBooleanType GetExecutionPath(char *path,const size_t extent) #if defined(__GNU__) { char - *program_name, - *execution_path; + *program_name; ssize_t count; @@ -1082,13 +1081,14 @@ MagickPrivate MagickBooleanType GetExecutionPath(char *path,const size_t extent) } if (count != -1) { - execution_path=realpath(program_name,NULL); - if (execution_path != (char *) NULL) + char + execution_path[PATH_MAX+1]; + + if (realpath(program_name,execution_path) != (char *) NULL) (void) CopyMagickString(path,execution_path,extent); } if (program_name != program_invocation_name) program_name=(char *) RelinquishMagickMemory(program_name); - execution_path=(char *) RelinquishMagickMemory(execution_path); } #endif #if defined(__OpenBSD__) -- 2.40.0