Skip to content

Commit

Permalink
Use calloc() instead of malloc() + memset()
Browse files Browse the repository at this point in the history
No functional change intended.
  • Loading branch information
DemiMarie committed Apr 28, 2024
1 parent 696f831 commit 82cbe71
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions libqrexec/exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -382,12 +382,11 @@ struct qrexec_parsed_command *parse_qubes_rpc_command(

struct qrexec_parsed_command *cmd;

if (!(cmd = malloc(sizeof(*cmd)))) {
PERROR("malloc");
if (!(cmd = calloc(1, sizeof(*cmd)))) {
PERROR("calloc");
return NULL;
}

memset(cmd, 0, sizeof(*cmd));
cmd->send_service_descriptor = true;
cmd->cmdline = cmdline;

Expand Down

0 comments on commit 82cbe71

Please sign in to comment.