mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-07-16 08:41:51 +03:00
examples: Check allocation results to give better examples
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Norbert Pocs <npocs@redhat.com>
This commit is contained in:
@ -94,6 +94,9 @@ cleanup_push(struct cleanup_node_struct** head_ref,
|
||||
{
|
||||
// Allocate memory for node
|
||||
struct cleanup_node_struct *new_node = malloc(sizeof *new_node);
|
||||
if (new_node == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (*head_ref != NULL) {
|
||||
new_node->next = *head_ref;
|
||||
|
Reference in New Issue
Block a user