summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/string.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/string.c b/src/string.c
index acaa41a..5ef90b0 100644
--- a/src/string.c
+++ b/src/string.c
@@ -167,12 +167,12 @@ const char *ssh_string_get_char(struct ssh_string_struct *s)
* string may not be readable with regular libc functions.
*/
char *ssh_string_to_char(struct ssh_string_struct *s) {
- size_t len;
- char *new;
- if (s == NULL)
- return NULL;
- len = ssh_string_len(s) + 1;
- new = malloc(len);
+ size_t len;
+ char *new;
+
+ if (s == NULL) {
+ return NULL;
+ }
len = ssh_string_len(s);
if (len + 1 < len) {