Euphoria Ticket #799: gets() memory leak

When gets() is called, we allocate a sequence to hold the data. However, if we are at EOF, we never release the sequence, resulting in a memory leak equivalent to a 133 element sequence:

	line = (s1_ptr)EMalloc(bufsize * sizeof(object) + sizeof( struct s1 )); 
	if (oldc == EOF) { 
		// No input characters where actually read. 
		return (object)ATOM_M1; 


Type: Bug Report Severity: Normal Category: Language
Assigned To: mattlewis Status: Fixed Reported Release: 4.0.4
Fixed in SVN #: View VCS: none Milestone: 4.0.6

1. Comment by mattlewis Oct 24, 2012

See: hg:euphoria/rev/eeb673da6708

changeset: 5799:eeb673da6708 branch: 4.0 parent: 5795:70a08419eeff user: Matt Lewis date: Wed Oct 24 14:10:35 2012 -0400 files: docs/release/4.0.6.txt source/be_runtime.c description:

  • fix memory leak in gets() when reading EOF
  • fixes ticket 799


Quick Links

User menu

Not signed in.

Misc Menu