From: Cristy Date: Sat, 7 Oct 2017 20:43:37 +0000 (-0400) Subject: ... X-Git-Tag: 7.0.7-8~36 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c002d59f5023b85db7db9e11f6e06a4dda9941a8;p=imagemagick ... --- 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__)