From 4b1fcc8ba2fd0d347a6dd3afcb610d12d4731aa4 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sun, 4 Aug 2013 19:33:46 +0000 Subject: [PATCH] Remove some redundant null-pointer checks from code that must have been written before I wrote a never-failing snew. [originally from svn r9985] --- sshdss.c | 4 ---- sshrsa.c | 4 ---- 2 files changed, 8 deletions(-) diff --git a/sshdss.c b/sshdss.c index 8c9f93e3..e634b984 100644 --- a/sshdss.c +++ b/sshdss.c @@ -89,8 +89,6 @@ static void *dss_newkey(char *data, int len) struct dss_key *dss; dss = snew(struct dss_key); - if (!dss) - return NULL; getstring(&data, &len, &p, &slen); #ifdef DEBUG_DSS @@ -430,8 +428,6 @@ static void *dss_openssh_createkey(unsigned char **blob, int *len) struct dss_key *dss; dss = snew(struct dss_key); - if (!dss) - return NULL; dss->p = getmp(b, len); dss->q = getmp(b, len); diff --git a/sshrsa.c b/sshrsa.c index 07853646..3bd971f8 100644 --- a/sshrsa.c +++ b/sshrsa.c @@ -558,8 +558,6 @@ static void *rsa2_newkey(char *data, int len) struct RSAKey *rsa; rsa = snew(struct RSAKey); - if (!rsa) - return NULL; getstring(&data, &len, &p, &slen); if (!p || slen != 7 || memcmp(p, "ssh-rsa", 7)) { @@ -694,8 +692,6 @@ static void *rsa2_openssh_createkey(unsigned char **blob, int *len) struct RSAKey *rsa; rsa = snew(struct RSAKey); - if (!rsa) - return NULL; rsa->comment = NULL; rsa->modulus = getmp(b, len);