diff options
author | Colin Walters <walters@verbum.org> | 2019-10-16 13:44:46 +0000 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2019-10-16 13:44:46 +0000 |
commit | a8dc90b02fbbd7b951be59704d4c5969463ab8f2 (patch) | |
tree | 420edfaf56b0e7e069245b71c2b602577399426b /src/ostree/ot-dump.c | |
parent | 4a38b1115973a8cd00608dc7bc4df96ae93bb79e (diff) | |
download | ostree-a8dc90b02fbbd7b951be59704d4c5969463ab8f2.tar.gz |
tree-wide: [scan-build]: Add some asserts that pointers are non-NULL
More "scan-build doesn't understand GError and our out-param conventions"
AKA "these errors would be impossible with Rust's sum type Result<> approach".
Diffstat (limited to 'src/ostree/ot-dump.c')
-rw-r--r-- | src/ostree/ot-dump.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ostree/ot-dump.c b/src/ostree/ot-dump.c index 1ef63740..38f3730b 100644 --- a/src/ostree/ot-dump.c +++ b/src/ostree/ot-dump.c @@ -125,7 +125,10 @@ dump_commit (GVariant *variant, timestamp = GUINT64_FROM_BE (timestamp); str = format_timestamp (timestamp, &local_error); if (!str) - errx (1, "Failed to read commit: %s", local_error->message); + { + g_assert (local_error); /* Pacify static analysis */ + errx (1, "Failed to read commit: %s", local_error->message); + } g_autofree char *contents = ostree_commit_get_content_checksum (variant) ?: "<invalid commit>"; g_print ("ContentChecksum: %s\n", contents); g_print ("Date: %s\n", str); |