summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2022-10-11 17:05:34 +0100
committerColin Watson <cjwatson@debian.org>2022-10-11 17:05:34 +0100
commit737e0215d9455222112ae73711fb87df828ae648 (patch)
treeade4a70c8dcb0888dc8467053652fb7c07d1d50f
parent514c06799383b4c74fcf64f4c75231863b445db3 (diff)
Assert that another xasprintf call returns non-NULL
As with commit a22f140354c80a7c5c52c4a413f1c929e105a24c, `gcc -fanalyzer` notices that `xasprintf` can return NULL in some situations. I believe those situations would all amount to programming errors here, so add an assert. * src/mandb.c (main): Assert that `xasprintf` returns non-NULL.
-rw-r--r--src/mandb.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/mandb.c b/src/mandb.c
index 1817153b..751f942e 100644
--- a/src/mandb.c
+++ b/src/mandb.c
@@ -965,6 +965,7 @@ int main (int argc, char *argv[])
subdirpath = xasprintf ("%s/%s", mp,
subdirent->d_name);
+ assert (subdirpath);
ret = process_manpath (subdirpath, global_manpath,
tried_catdirs);
if (ret < 0)