aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libssh/keyfiles.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/libssh/keyfiles.c b/libssh/keyfiles.c
index 0e73fcba..f21cbe1f 100644
--- a/libssh/keyfiles.c
+++ b/libssh/keyfiles.c
@@ -1019,11 +1019,12 @@ static int alldigits(const char *s) {
*/
static char *lowercase(const char* str) {
char *p = 0;
- char *new = strdup(str);
+ char *new = NULL;
- if((str == NULL) || (new == NULL)) {
- return NULL;
- }
+ if(str == NULL) return NULL;
+
+ new = strdup(str);
+ if(new == NULL) return NULL;
for (p = new; *p; p++) {
*p = tolower(*p);