1
0
mirror of https://github.com/systemd/systemd.git synced 2025-02-10 17:57:40 +03:00

Merge pull request #16864 from yuwata/coverity-fixes

Two coverity fixes
This commit is contained in:
Lennart Poettering 2020-08-27 16:36:40 +02:00 committed by GitHub
commit df92f4fa8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 7 deletions

View File

@ -3127,8 +3127,10 @@ static int apply_mount_namespace(
if (exec_context_has_credentials(context) && params->prefix[EXEC_DIRECTORY_RUNTIME]) {
creds_path = path_join(params->prefix[EXEC_DIRECTORY_RUNTIME], "credentials", u->id);
if (!creds_path)
return -ENOMEM;
if (!creds_path) {
r = -ENOMEM;
goto finalize;
}
}
r = setup_namespace(root_dir, root_image, context->root_image_options,
@ -3174,6 +3176,7 @@ static int apply_mount_namespace(
}
}
finalize:
bind_mount_free_many(bind_mounts, n_bind_mounts);
return r;
}

View File

@ -927,11 +927,12 @@ int compress_stream_zstd(int fdf, int fdt, uint64_t max_bytes) {
break;
}
log_debug(
"ZSTD compression finished (%" PRIu64 " -> %" PRIu64 " bytes, %.1f%%)",
in_bytes,
max_bytes - left,
(double) (max_bytes - left) / in_bytes * 100);
if (in_bytes > 0)
log_debug("ZSTD compression finished (%" PRIu64 " -> %" PRIu64 " bytes, %.1f%%)",
in_bytes, max_bytes - left, (double) (max_bytes - left) / in_bytes * 100);
else
log_debug("ZSTD compression finished (%" PRIu64 " -> %" PRIu64 " bytes)",
in_bytes, max_bytes - left);
return 0;
#else