Fix use-after-free
diff --git a/prototype.c b/prototype.c
index 7f91897..a892666 100644
--- a/prototype.c
+++ b/prototype.c
@@ -564,11 +564,11 @@
 	    || (*retp == NULL
 		&& load_config(cache, key, 0, retp) < 0))
 	{
-		if (!own_key)
-			free((void *) key);
 		fprintf(stderr,
 			"Error occurred when attempting to load a prototype "
 			"library for %s.\n", key);
+		if (!own_key)
+			free((void *) key);
 		return -1;
 	}