瀏覽代碼

* fixed memory leak in executeprocess for FPC_USE_FPEXEC

git-svn-id: trunk@6826 -
Jonas Maebe 18 年之前
父節點
當前提交
95474a2d38
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      rtl/unix/sysutils.pp

+ 5 - 0
rtl/unix/sysutils.pp

@@ -911,6 +911,11 @@ Begin
   { We're in the parent, let's wait. }
   result:=WaitProcess(pid); // WaitPid and result-convert
 
+  {$ifdef FPC_USE_FPEXEC}
+  if Comline<>'' Then
+    freemem(cmdline2);
+  {$endif}
+
   if (result<0) or (result=127) then
     begin
     E:=EOSError.CreateFmt(SExecuteProcessFailed,[Path,result]);