From de2997a4cf22ca0a524f0e5b451693c583e2fd89 Mon Sep 17 00:00:00 2001 From: "djm@openbsd.org" Date: Mon, 16 Jul 2018 03:09:13 +0000 Subject: upstream: memleaks; found by valgrind OpenBSD-Commit-ID: 6c3ba22be53e753c899545f771e8399fc93cd844 --- hostfile.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'hostfile.c') diff --git a/hostfile.c b/hostfile.c index e0833937..e1f826bd 100644 --- a/hostfile.c +++ b/hostfile.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hostfile.c,v 1.72 2018/06/06 18:29:18 markus Exp $ */ +/* $OpenBSD: hostfile.c,v 1.73 2018/07/16 03:09:13 djm Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -683,11 +683,11 @@ hostkeys_foreach(const char *path, hostkeys_foreach_fn *callback, void *ctx, linenum++; line[strcspn(line, "\n")] = '\0'; + free(lineinfo.line); sshkey_free(lineinfo.key); memset(&lineinfo, 0, sizeof(lineinfo)); lineinfo.path = path; lineinfo.linenum = linenum; - free(lineinfo.line); lineinfo.line = xstrdup(line); lineinfo.marker = MRK_NONE; lineinfo.status = HKF_STATUS_OK; -- cgit v1.2.3