*** a/contrib/vacuumlo/vacuumlo.c
--- b/contrib/vacuumlo/vacuumlo.c
***************
*** 240,245 **** vacuumlo(const char *database, const struct _param * param)
--- 240,251 ----
  			fprintf(stderr, "Out of memory\n");
  			PQclear(res);
  			PQfinish(conn);
+ 			if (schema != NULL)
+ 				PQfreemem(schema);
+ 			if (schema != NULL)
+ 				PQfreemem(table);
+ 			if (schema != NULL)
+ 				PQfreemem(field);
  			return -1;
  		}
  
***************
*** 256,261 **** vacuumlo(const char *database, const struct _param * param)
--- 262,270 ----
  			PQclear(res2);
  			PQclear(res);
  			PQfinish(conn);
+ 			PQfreemem(schema);
+ 			PQfreemem(table);
+ 			PQfreemem(field);
  			return -1;
  		}
  		PQclear(res2);
