Skip to content

Commit

Permalink
Merge pull request #3098 from schveiguy/fixreadlnmem
Browse files Browse the repository at this point in the history
Make sure the free'd lineptr doesn't leave a dangling pointer.
  • Loading branch information
andralex committed Mar 24, 2015
2 parents f9c309f + 5f1ab79 commit f77b387
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions std/stdio.d
Expand Up @@ -4159,6 +4159,7 @@ private size_t readlnImpl(FILE* fps, ref char[] buf, dchar terminator, File.Orie
{
// Bound memory used by readln
free(lineptr);
lineptr = null;
n = 0;
}
}
Expand Down

0 comments on commit f77b387

Please sign in to comment.