Calloc may return NULL. So we must check the return value.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
/* We only expose the "active" eth device, so one is enough */
netobj = calloc(1, sizeof(*netobj));
/* We only expose the "active" eth device, so one is enough */
netobj = calloc(1, sizeof(*netobj));
+ if (!netobj) {
+ printf("ERROR: Out of memory\n");
+ return 1;
+ }
/* Fill in object data */
netobj->parent.protocols[0].guid = &efi_net_guid;
/* Fill in object data */
netobj->parent.protocols[0].guid = &efi_net_guid;