]> granicus.if.org Git - postgresql/commitdiff
Initialize cached OID to Invalid in new hash entries
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Tue, 27 Aug 2013 18:53:17 +0000 (14:53 -0400)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Tue, 27 Aug 2013 18:53:17 +0000 (14:53 -0400)
Andres Freund; bug detected by valgrind

src/backend/utils/cache/relfilenodemap.c

index 2a8f83775d26c6daa3f2a2ac2891ee2c4b81dafc..f3f9a098996a9f1c3eadca8248a0591fcefcd026 100644 (file)
@@ -180,6 +180,9 @@ RelidByRelfilenode(Oid reltablespace, Oid relfilenode)
        if (found)
                return entry->relid;
 
+       /* initialize empty/negative cache entry before doing the actual lookup */
+       entry->relid = InvalidOid;
+
        /* ok, no previous cache entry, do it the hard way */
 
        /* check shared tables */