From 5f1ab797174332f57eba62689970b79052d53dfc Mon Sep 17 00:00:00 2001 From: Steven Schveighoffer Date: Mon, 23 Mar 2015 21:30:54 -0400 Subject: [PATCH] Make sure the free'd lineptr doesn't leave a dangling pointer. --- std/stdio.d | 1 + 1 file changed, 1 insertion(+) diff --git a/std/stdio.d b/std/stdio.d index 0bbd7447d98..af977d92629 100644 --- a/std/stdio.d +++ b/std/stdio.d @@ -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; } }