--- a/toybox-4428d64c0c40/toys/posix/find.c	2014-09-04 10:53:51.000000000 +0530
+++ b/Toybox/toys/posix/find.c	2014-09-05 10:23:10.380538114 +0530
@@ -315,10 +315,11 @@
         }
       } else if (!strcmp(s, "type")) {
         if (check) {
-          char c = stridx("bcdlpfs", *ss[1]);
+          signed char c = stridx("bcdlpfs", *ss[1]);
           int types[] = {S_IFBLK, S_IFCHR, S_IFDIR, S_IFLNK, S_IFIFO,
                          S_IFREG, S_IFSOCK};
 
+          if (c<0) error_exit("Unknown argument to -type: '%s'", ss[1]);
           if ((new->st.st_mode & S_IFMT) != types[c]) test = 0;
         }
 
@@ -447,7 +448,11 @@
 
           if (*s == 'o') {
             char *prompt = xmprintf("[%s] %s", ss1, name);
-            if(!(test = yesno(prompt, 0))) goto cont;
+            if(!(test = yesno(prompt, 0))) {
+              free(prompt);
+              free(name);
+              goto cont;
+            }
           }
 
           // Add next name to list (global list without -dir, local with)
