We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fa6e244 commit 6256d7fCopy full SHA for 6256d7f
1 file changed
lib/setup.c
@@ -599,11 +599,9 @@ int crypt_init(struct crypt_device **cd, const char *device)
599
log_dbg(NULL, "Running without O_CLOEXEC.");
600
#endif
601
602
- if (!(h = malloc(sizeof(struct crypt_device))))
+ if (!(h = crypt_zalloc(sizeof(struct crypt_device))))
603
return -ENOMEM;
604
605
- memset(h, 0, sizeof(*h));
606
-
607
r = device_alloc(NULL, &h->device, device);
608
if (r < 0) {
609
free(h);
0 commit comments