Skip to content

Commit

Permalink
fix a couple of minor nits scan-build found.
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Jones <[email protected]>
  • Loading branch information
vathpela committed Nov 8, 2021
1 parent f2478b9 commit 2b3ca2b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ check_cmd_version(int sd, uint32_t command, char *name, int32_t version, bool do
char *srvmsg = NULL;
int32_t rc = check_response(sd, &srvmsg);

if (srvmsg)
free(srvmsg);

if (do_exit && rc < 0)
errx(1, "command \"%s\" not known by server", name);
if (do_exit && rc != version)
Expand Down
3 changes: 1 addition & 2 deletions src/cms_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -1560,8 +1560,7 @@ generate_name(cms_context *cms, SECItem *der, CERTName *certname)

while (rdns && (rdn = *rdns++) != NULL) {
CERTAVA **avas = rdn->avas;
CERTAVA *ava;
while (avas && (ava = *avas++) != NULL)
while (avas && ((*avas++) != NULL))
num_items++;
}

Expand Down
4 changes: 3 additions & 1 deletion src/daemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -1190,8 +1190,10 @@ daemonize(cms_context *cms_ctx, char *certdir, int do_fork)
sleep(2);
return 0;
}
ctx.pid = pid;
} else {
ctx.pid = getpid();
}
ctx.pid = getpid();
write_pid_file(ctx.pid);
ctx.backup_cms->log(ctx.backup_cms, ctx.priority|LOG_NOTICE,
"pesignd starting (pid %d)", ctx.pid);
Expand Down

0 comments on commit 2b3ca2b

Please sign in to comment.