1
1

string: Fix memory leak in ssh_string_to_char().

This was probably a mistake by me fixing up a patch after merging.
Этот коммит содержится в:
Andreas Schneider 2012-12-13 19:29:46 +01:00
родитель b14df297fa
Коммит de9bc1fa41

Просмотреть файл

@ -167,12 +167,12 @@ const char *ssh_string_get_char(struct ssh_string_struct *s)
* string may not be readable with regular libc functions. * string may not be readable with regular libc functions.
*/ */
char *ssh_string_to_char(struct ssh_string_struct *s) { char *ssh_string_to_char(struct ssh_string_struct *s) {
size_t len; size_t len;
char *new; char *new;
if (s == NULL)
return NULL; if (s == NULL) {
len = ssh_string_len(s) + 1; return NULL;
new = malloc(len); }
len = ssh_string_len(s); len = ssh_string_len(s);
if (len + 1 < len) { if (len + 1 < len) {