Simply move the free of ki_proc outside the realloc() loop.

This commit is contained in:
Todd C. Miller
2012-03-12 11:37:33 -04:00
parent 1ca5009563
commit 4bd136e11a

View File

@@ -129,9 +129,8 @@ get_process_ttyname(void)
sudo_debug_printf(SUDO_DEBUG_WARN, sudo_debug_printf(SUDO_DEBUG_WARN,
"unable to resolve tty via KERN_PROC: %s", strerror(errno)); "unable to resolve tty via KERN_PROC: %s", strerror(errno));
} }
efree(ki_proc);
ki_proc = NULL;
} }
efree(ki_proc);
/* If all else fails, fall back on ttyname(). */ /* If all else fails, fall back on ttyname(). */
if (tty == NULL) { if (tty == NULL) {