From 89540b6de025b80404a0cb8418c06377f3f98848 Mon Sep 17 00:00:00 2001 From: "mmcc@openbsd.org" Date: Fri, 11 Dec 2015 02:31:47 +0000 Subject: upstream commit Remove NULL-checks before sshkey_free(). ok djm@ Upstream-ID: 3e35afe8a25e021216696b5d6cde7f5d2e5e3f52 --- authfile.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'authfile.c') diff --git a/authfile.c b/authfile.c index 668df7d9e..9cd490ca3 100644 --- a/authfile.c +++ b/authfile.c @@ -1,4 +1,4 @@ -/* $OpenBSD: authfile.c,v 1.118 2015/12/10 17:08:40 mmcc Exp $ */ +/* $OpenBSD: authfile.c,v 1.119 2015/12/11 02:31:47 mmcc Exp $ */ /* * Copyright (c) 2000, 2013 Markus Friedl. All rights reserved. * @@ -427,8 +427,7 @@ sshkey_load_cert(const char *filename, struct sshkey **keyp) out: free(file); - if (pub != NULL) - sshkey_free(pub); + sshkey_free(pub); return r; } @@ -473,10 +472,8 @@ sshkey_load_private_cert(int type, const char *filename, const char *passphrase, *keyp = key; key = NULL; out: - if (key != NULL) - sshkey_free(key); - if (cert != NULL) - sshkey_free(cert); + sshkey_free(key); + sshkey_free(cert); return r; } @@ -537,8 +534,7 @@ sshkey_in_file(struct sshkey *key, const char *filename, int strict_type, } r = SSH_ERR_KEY_NOT_FOUND; out: - if (pub != NULL) - sshkey_free(pub); + sshkey_free(pub); fclose(f); return r; } -- cgit v1.2.3