bpo-32571: Fix reading uninitialized memory (GH-5332)

Reported by Coverity Scan.
diff --git a/Objects/object.c b/Objects/object.c
index 7b2adbe..fef57fc 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -917,6 +917,11 @@
         }
         *result = (*tp->tp_getattr)(v, (char *)name_str);
     }
+    else {
+        *result = NULL;
+        return 0;
+    }
+
     if (*result != NULL) {
         return 1;
     }