diff --git a/src/string.c b/src/string.c index e78737b3..ba9283b2 100644 --- a/src/string.c +++ b/src/string.c @@ -62,13 +62,12 @@ struct ssh_string_struct *ssh_string_new(size_t size) return NULL; } - str = malloc(sizeof(struct ssh_string_struct) + size); + str = calloc(1, sizeof(struct ssh_string_struct) + size); if (str == NULL) { return NULL; } str->size = htonl((uint32_t)size); - str->data[0] = 0; return str; }