-/* $OpenBSD: authfile.c,v 1.119 2015/12/11 02:31:47 mmcc Exp $ */
+/* $OpenBSD: authfile.c,v 1.120 2015/12/11 04:21:11 mmcc Exp $ */
/*
* Copyright (c) 2000, 2013 Markus Friedl. All rights reserved.
*
/* success */
r = 0;
out:
- if (buffer != NULL)
- sshbuf_free(buffer);
+ sshbuf_free(buffer);
return r;
}
r = 0;
out:
close(fd);
- if (buffer != NULL)
- sshbuf_free(buffer);
+ sshbuf_free(buffer);
return r;
}
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $OpenBSD: krl.c,v 1.35 2015/12/04 16:41:28 markus Exp $ */
+/* $OpenBSD: krl.c,v 1.36 2015/12/11 04:21:12 mmcc Exp $ */
#include "includes.h"
goto out;
while (sshbuf_len(buf) > 0) {
- if (subsect != NULL) {
- sshbuf_free(subsect);
- subsect = NULL;
- }
+ sshbuf_free(subsect);
+ subsect = NULL;
if ((r = sshbuf_get_u8(buf, &type)) != 0 ||
(r = sshbuf_froms(buf, &subsect)) != 0)
goto out;
if ((r = sshbuf_consume(copy, sects_off)) != 0)
goto out;
while (sshbuf_len(copy) > 0) {
- if (sect != NULL) {
- sshbuf_free(sect);
- sect = NULL;
- }
+ sshbuf_free(sect);
+ sect = NULL;
if ((r = sshbuf_get_u8(copy, &type)) != 0 ||
(r = sshbuf_froms(copy, §)) != 0)
goto out;
-/* $OpenBSD: packet.c,v 1.220 2015/12/11 03:24:25 djm Exp $ */
+/* $OpenBSD: packet.c,v 1.221 2015/12/11 04:21:12 mmcc Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
goto out;
r = sshbuf_put_stringb(m, b);
out:
- if (b != NULL)
- sshbuf_free(b);
+ sshbuf_free(b);
return r;
}
r = 0;
out:
free(newkey);
- if (b != NULL)
- sshbuf_free(b);
+ sshbuf_free(b);
return r;
}
out:
if (r != 0 || kexp == NULL) {
if (kex != NULL) {
- if (kex->my != NULL)
- sshbuf_free(kex->my);
- if (kex->peer != NULL)
- sshbuf_free(kex->peer);
+ sshbuf_free(kex->my);
+ sshbuf_free(kex->peer);
free(kex);
}
if (kexp != NULL)
-/* $OpenBSD: ssh-dss.c,v 1.33 2015/12/10 17:08:40 mmcc Exp $ */
+/* $OpenBSD: ssh-dss.c,v 1.34 2015/12/11 04:21:12 mmcc Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
*
explicit_bzero(digest, sizeof(digest));
if (sig != NULL)
DSA_SIG_free(sig);
- if (b != NULL)
- sshbuf_free(b);
+ sshbuf_free(b);
return ret;
}
explicit_bzero(digest, sizeof(digest));
if (sig != NULL)
DSA_SIG_free(sig);
- if (b != NULL)
- sshbuf_free(b);
+ sshbuf_free(b);
free(ktype);
if (sigblob != NULL) {
explicit_bzero(sigblob, len);
-/* $OpenBSD: ssh-ecdsa.c,v 1.11 2014/06/24 01:13:21 djm Exp $ */
+/* $OpenBSD: ssh-ecdsa.c,v 1.12 2015/12/11 04:21:12 mmcc Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
* Copyright (c) 2010 Damien Miller. All rights reserved.
ret = 0;
out:
explicit_bzero(digest, sizeof(digest));
- if (b != NULL)
- sshbuf_free(b);
- if (bb != NULL)
- sshbuf_free(bb);
+ sshbuf_free(b);
+ sshbuf_free(bb);
if (sig != NULL)
ECDSA_SIG_free(sig);
return ret;
out:
explicit_bzero(digest, sizeof(digest));
- if (sigbuf != NULL)
- sshbuf_free(sigbuf);
- if (b != NULL)
- sshbuf_free(b);
+ sshbuf_free(sigbuf);
+ sshbuf_free(b);
if (sig != NULL)
ECDSA_SIG_free(sig);
free(ktype);
-/* $OpenBSD: ssh-rsa.c,v 1.57 2015/12/10 17:08:40 mmcc Exp $ */
+/* $OpenBSD: ssh-rsa.c,v 1.58 2015/12/11 04:21:12 mmcc Exp $ */
/*
* Copyright (c) 2000, 2003 Markus Friedl <markus@openbsd.org>
*
explicit_bzero(sig, slen);
free(sig);
}
- if (b != NULL)
- sshbuf_free(b);
+ sshbuf_free(b);
return ret;
}
free(sigblob);
}
free(ktype);
- if (b != NULL)
- sshbuf_free(b);
+ sshbuf_free(b);
explicit_bzero(digest, sizeof(digest));
return ret;
}
-/* $OpenBSD: sshbuf.c,v 1.4 2015/10/05 17:11:21 djm Exp $ */
+/* $OpenBSD: sshbuf.c,v 1.5 2015/12/11 04:21:12 mmcc Exp $ */
/*
* Copyright (c) 2011 Damien Miller
*
* If we are a child, the free our parent to decrement its reference
* count and possibly free it.
*/
- if (buf->parent != NULL) {
- sshbuf_free(buf->parent);
- buf->parent = NULL;
- }
+ sshbuf_free(buf->parent);
+ buf->parent = NULL;
/*
* If we are a parent with still-extant children, then don't free just
* yet. The last child's call to sshbuf_free should decrement our
-/* $OpenBSD: sshkey.c,v 1.30 2015/12/11 02:31:47 mmcc Exp $ */
+/* $OpenBSD: sshkey.c,v 1.31 2015/12/11 04:21:12 mmcc Exp $ */
/*
* Copyright (c) 2000, 2001 Markus Friedl. All rights reserved.
* Copyright (c) 2008 Alexander von Gernler. All rights reserved.
if (cert == NULL)
return;
- if (cert->certblob != NULL)
- sshbuf_free(cert->certblob);
- if (cert->critical != NULL)
- sshbuf_free(cert->critical);
- if (cert->extensions != NULL)
- sshbuf_free(cert->extensions);
+ sshbuf_free(cert->certblob);
+ sshbuf_free(cert->critical);
+ sshbuf_free(cert->extensions);
free(cert->key_id);
for (i = 0; i < cert->nprincipals; i++)
free(cert->principals[i]);
sshbuf_reset(cert);
free(sig_blob);
free(ca_blob);
- if (principals != NULL)
- sshbuf_free(principals);
+ sshbuf_free(principals);
return ret;
}
out:
explicit_bzero(&ciphercontext, sizeof(ciphercontext));
explicit_bzero(buf, sizeof(buf));
- if (buffer != NULL)
- sshbuf_free(buffer);
- if (encrypted != NULL)
- sshbuf_free(encrypted);
+ sshbuf_free(buffer);
+ sshbuf_free(encrypted);
return r;
}
pub = NULL;
out:
- if (copy != NULL)
- sshbuf_free(copy);
+ sshbuf_free(copy);
sshkey_free(pub);
return r;
}
explicit_bzero(&ciphercontext, sizeof(ciphercontext));
free(comment);
sshkey_free(prv);
- if (copy != NULL)
- sshbuf_free(copy);
- if (decrypted != NULL)
- sshbuf_free(decrypted);
+ sshbuf_free(copy);
+ sshbuf_free(decrypted);
return r;
}
#endif /* WITH_SSH1 */