diff --git a/sway/config.c b/sway/config.c
index c362f3889..1973de02d 100644
--- a/sway/config.c
+++ b/sway/config.c
@@ -174,11 +174,9 @@ static char *get_config_path(void) {
 		if (wordexp(config_paths[i], &p, 0) == 0) {
 			path = p.we_wordv[0];
 			if (file_exists(path)) {
-				wordfree(&p);
 				return path;
 			}
 		}
-		wordfree(&p);
 	}
 
 	return NULL; // Not reached