python, java: Avoid bogus -fanalyzer warnings

This is essentially the same as the previous OCaml commit.  It does
not fix a real bug.
This commit is contained in:
Richard W.M. Jones
2021-09-07 16:48:26 +01:00
parent ea04d6b878
commit ceb034c92c
2 changed files with 2 additions and 2 deletions

View File

@@ -88,7 +88,7 @@ guestfs_int_py_close (PyObject *self, PyObject *args)
guestfs_close (g);
Py_END_ALLOW_THREADS;
if (len > 0) {
if (callbacks && len > 0) {
size_t i;
for (i = 0; i < len; ++i)
Py_XDECREF (callbacks[i]);