OSDN Git Service

Minor cleanups
authorTeodor Sigaev <teodor@sigaev.ru>
Mon, 3 Apr 2006 08:37:41 +0000 (08:37 +0000)
committerTeodor Sigaev <teodor@sigaev.ru>
Mon, 3 Apr 2006 08:37:41 +0000 (08:37 +0000)
contrib/intarray/_int_gist.c
contrib/intarray/_intbig_gist.c

index e8cf24f..e2f1225 100644 (file)
@@ -47,8 +47,10 @@ g_int_consistent(PG_FUNCTION_ARGS)
 
        /* sort query for fast search, key is already sorted */
        CHECKARRVALID(query);
-       if (ARRISVOID(query))
+       if (ARRISVOID(query)) {
+               pfree( query );
                PG_RETURN_BOOL(false);
+       }
        PREPAREARR(query);
 
        switch (strategy)
index caa0ad4..ecd949d 100644 (file)
@@ -510,12 +510,14 @@ g_intbig_consistent(PG_FUNCTION_ARGS)
                                                                          GETSIGN(DatumGetPointer(entry->key)),
                                                                          false);
                PG_FREE_IF_COPY( query, 1 );
-               return retval;
+               PG_RETURN_BOOL(retval);
        }
 
        CHECKARRVALID(query);
-       if (ARRISVOID(query))
-               return FALSE;
+       if (ARRISVOID(query)) {
+               PG_FREE_IF_COPY( query, 1 );
+               PG_RETURN_BOOL(FALSE);
+       }
 
        switch (strategy)
        {