Imported from ../bash-2.02.1.tar.gz.
[platform/upstream/bash.git] / builtins / exec.def
index cc7f5a9..d7166d7 100644 (file)
@@ -49,6 +49,7 @@ $END
 
 #include "../shell.h"
 #include "../execute_cmd.h"
+#include "../findcmd.h"
 #if defined (JOB_CONTROL)
 #  include "../jobs.h"
 #endif
@@ -190,6 +191,11 @@ exec_builtin (list)
 #endif /* JOB_CONTROL */
 
   shell_execve (command, args, env);
+
+  /* We have to set this to NULL because shell_execve has called realloc()
+     to stuff more items at the front of the array, which may have caused
+     the memory to be freed by realloc().  We don't want to free it twice. */
+  args = (char **)NULL;
   if (cleanenv == 0)
     adjust_shell_level (1);