diff --git a/src/tincctl.c b/src/tincctl.c
index eaf14e03..45bf6ee5 100644
--- a/src/tincctl.c
+++ b/src/tincctl.c
@@ -1838,6 +1838,8 @@ static int cmd_export(int argc, char *argv[]) {
 	int result = export(name, stdout);
 	if(!tty)
 		fclose(stdout);
+
+	free(name);
 	return result;
 }