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:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user