Index: uspace/app/bdsh/exec.c
===================================================================
--- uspace/app/bdsh/exec.c	(revision accdbd830beca44bcb50139f5c5e256cbe7afda9)
+++ uspace/app/bdsh/exec.c	(revision 96e94347dd0af60c9e57403a95da7a05142ac685)
@@ -47,7 +47,4 @@
 #include "errors.h"
 
-/* FIXME: Just have find_command() return an allocated string */
-static char *found;
-
 static char *find_command(char *);
 static int try_access(const char *);
@@ -76,11 +73,10 @@
 	size_t i;
 
-	found = (char *)malloc(PATH_MAX);
-
 	/* The user has specified a full or relative path, just give it back. */
 	if (-1 != try_access(cmd)) {
-		return (char *) cmd;
+		return str_dup(cmd);
 	}
 
+	char *found = (char *)malloc(PATH_MAX);
 	/* We now have n places to look for the command */
 	for (i = 0; search_dir[i] != NULL; i++) {
@@ -91,7 +87,8 @@
 		}
 	}
+	free(found);
 
 	/* We didn't find it, just give it back as-is. */
-	return (char *) cmd;
+	return str_dup(cmd);
 }
 
@@ -107,6 +104,5 @@
 	FILE *files[3];
 
-	tmp = str_dup(find_command(cmd));
-	free(found);
+	tmp = find_command(cmd);
 
 	files[0] = io->stdin;
