Changeset - 4f90c21755ee
[Not reviewed]
default
0 1 0
Nathan Brink (binki) - 16 years ago 2009-04-18 23:11:46
ohnobinki@ohnopublishing.net
fixed memory leak in execio
1 file changed with 2 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/common/execio.c
Show inline comments
 
@@ -220,16 +220,18 @@ int execio_close(struct execio *eio)
 

	
 
  close(eio->pipe_read);
 
  close(eio->pipe_write);
 

	
 
  /* maybe we should just kill rather than term the child */
 
  kill(eio->child, SIGTERM);
 
  /* 
 
     the waitpid(2) seems to indicate that only when the child is terminated will this wait return. 
 
     This are of code will probably need improving - the ability to seng SIGKILL after a timeout? So we'll output a debug line before running waitpid
 
  */
 
  fprintf(stderr, "execio_close: running waitpid\n");
 
  waitpid(eio->child, &childstatus, 0);
 

	
 
  free(eio);
 
  
 
  return 0;
 
}
 

	
0 comments (0 inline, 0 general)