Round #1 of scan-build warnings cleanup

This commit is contained in:
Nicolas Williams
2016-11-15 19:38:04 -06:00
parent 274021f7db
commit 953dc07391
13 changed files with 53 additions and 39 deletions

View File

@@ -104,7 +104,7 @@ restarter(krb5_context context, size_t *countp)
{
#if defined(HAVE_FORK) && defined(HAVE_WAITPID)
struct timeval tmout;
pid_t pid;
pid_t pid = -1;
pid_t wpid = -1;
int status;
int fds[2];

View File

@@ -911,7 +911,7 @@ main(int argc, char **argv)
continue;
}
if (FD_ISSET(restarter_fd, &readset)) {
if (restarter_fd > -1 && FD_ISSET(restarter_fd, &readset)) {
if (verbose)
krb5_warnx(context, "slave restarter exited");
exit_flag = SIGTERM;

View File

@@ -205,6 +205,9 @@ get_header(krb5_storage *sp, int peek, uint32_t *verp, uint32_t *tstampp,
*verp = 0;
*tstampp = 0;
if (opp != NULL)
*opp = kadm_nop;
*lenp = 0;
off = krb5_storage_seek(sp, 0, SEEK_CUR);
if (off < 0)
@@ -728,8 +731,7 @@ kadm5_log_reinit(kadm5_server_context *server_context, uint32_t vno)
/* Write uber entry and truncation nop with version `vno` */
log_context->version = vno;
ret = kadm5_log_nop(server_context, kadm_nop_plain);
return 0;
return kadm5_log_nop(server_context, kadm_nop_plain);
}
/* Close the server_context->log_context. */
@@ -1537,7 +1539,8 @@ kadm5_log_replay_modify(kadm5_server_context *context,
ent.entry.keys.val = malloc(len * sizeof(*ent.entry.keys.val));
if (ent.entry.keys.val == NULL) {
krb5_set_error_message(context->context, ENOMEM, "out of memory");
return ENOMEM;
ret = ENOMEM;
goto out;
}
for (i = 0; i < ent.entry.keys.len; ++i) {
ret = copy_Key(&log_ent.entry.keys.val[i],