1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-08-08 19:02:06 +03:00

pki: Fixed a possible crash.

This commit is contained in:
Andreas Schneider
2010-09-18 20:59:29 +02:00
parent f7ea9a3f27
commit fe31fcaeef

View File

@@ -34,10 +34,13 @@
/**
* @brief creates a new empty SSH key
* @returns an empty ssh_key handle
* @returns an empty ssh_key handle, or NULL on error.
*/
ssh_key ssh_key_new (void){
ssh_key ptr=malloc (sizeof (struct ssh_key_struct));
ssh_key ssh_key_new (void) {
ssh_key ptr = malloc (sizeof (struct ssh_key_struct));
if (ptr == NULL) {
return NULL;
}
ZERO_STRUCTP(ptr);
return ptr;
}