Index: trunk/psastro/src/psastroChooseRefstars.c
===================================================================
--- trunk/psastro/src/psastroChooseRefstars.c	(revision 9587)
+++ trunk/psastro/src/psastroChooseRefstars.c	(revision 9627)
@@ -79,8 +79,7 @@
 
 		psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSASTRO.REFSTARS", PS_DATA_ARRAY, "astrometry matches", refstars);
+		psFree (refstars);
 
 		psastroRefstarSubset (readout);
-
-		psFree (refstars);
 	    }
 	}
