--- a/avidemux_plugins/ADM_videoEncoder/x265/ADM_x265Setup.cpp
+++ b/avidemux_plugins/ADM_videoEncoder/x265/ADM_x265Setup.cpp
@@ -207,13 +207,13 @@ bool x265Encoder::setup(void)
                         {
                              param.rc.bStatWrite=1;
                              param.rc.bStatRead=0;
-                             param.rc.statFileName=strdup(logFile);
+                             strcpy(param.rc.statFileName, logFile);
  
                         }else
                         {
                              param.rc.bStatWrite=0;
                              param.rc.bStatRead=1;
-                             param.rc.statFileName=strdup(logFile);
+                             strcpy(param.rc.statFileName, logFile);
                              if(!ADM_fileExist(logFile))
                              {
                                    ADM_error("Logfile %s does not exist \n",logFile);
